@@ -55,8 +55,8 @@ protocol_t* PiCode::findProtocol(const char* name) {
55
55
return nullptr ;
56
56
}
57
57
58
- /* Convert from array of pulses and lenght to pilight string format. Must be free() after use */
59
- char * PiCode::pulseTrainToString (const uint32_t * pulses, unsigned int length, uint8_t repeats){
58
+ /* Convert from array of pulses and length to pilight string format. Must be free() after use */
59
+ char * PiCode::pulseTrainToString (const uint32_t * pulses, uint16_t length, uint8_t repeats){
60
60
61
61
bool match = false ;
62
62
int diff = 0 ;
@@ -77,7 +77,7 @@ char* PiCode::pulseTrainToString(const uint32_t* pulses, unsigned int length, ui
77
77
strcpy (data," c:" );
78
78
}
79
79
80
- for (unsigned int i = 0 ; i < length; i++) {
80
+ for (uint16_t i = 0 ; i < length; i++) {
81
81
match = false ;
82
82
for (uint8_t j = 0 ; j < MAX_PULSE_TYPES; j++) {
83
83
// We device these numbers by 10 to normalize them a bit
@@ -186,7 +186,7 @@ static int indexOf(const char* data, char ch, unsigned int fromIndex = 0) {
186
186
int PiCode::stringToPulseTrain (const char * data, uint32_t * pulses, size_t maxlength){
187
187
188
188
int length = 0 ; // length of pulse train
189
- unsigned int nrpulses = 0 ; // number of pulse types
189
+ uint8_t nrpulses = 0 ; // number of pulse types
190
190
uint32_t plstypes[MAX_PULSE_TYPES] = {0 }; // array to store pulse types
191
191
192
192
// Aux string to compose data string //
@@ -351,7 +351,7 @@ char* PiCode::encodeToString(const char* protocol_name, const char* json_data, u
351
351
if (protocol->createCode != nullptr ){
352
352
n_pulses = encodeToPulseTrain (pulses, protocol, json_data);
353
353
if (n_pulses > 0 ){
354
- result = pulseTrainToString (pulses,(unsigned int )n_pulses, repeats);
354
+ result = pulseTrainToString (pulses,(uint16_t )n_pulses, repeats);
355
355
}
356
356
}
357
357
}
0 commit comments