Explorar el Código

library update

Oliver Fabel hace 1 año
padre
commit
e6c5dd9ad3
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      mp_flipper_modflipperzero.c

+ 5 - 1
mp_flipper_modflipperzero.c

@@ -583,7 +583,11 @@ static mp_obj_t flipperzero_infrared_receive(size_t n_args, const mp_obj_t* args
     mp_obj_t* signal = length > 0 ? malloc(length * sizeof(mp_obj_t)) : NULL;
 
     for(uint16_t i = 0; i < length; i++) {
-        signal[i] = mp_obj_new_int(buffer[i]);
+        if(buffer[i]) {
+            signal[i] = mp_obj_new_int(buffer[i]);
+        } else {
+            signal[i] = mp_obj_new_int(-1);
+        }
     }
 
     return mp_obj_new_list(length, signal);