Oliver Fabel 1 год назад
Родитель
Сommit
7a3539090c
1 измененных файлов с 2 добавлено и 6 удалено
  1. 2 6
      mp_flipper_modflipperzero.c

+ 2 - 6
mp_flipper_modflipperzero.c

@@ -579,15 +579,11 @@ static mp_obj_t flipperzero_infrared_receive(size_t n_args, const mp_obj_t* args
     mp_int_t timeout = n_args > 0 ? mp_obj_get_int(args[0]) : MP_FLIPPER_INFRARED_RX_DEFAULT_TIMEOUT;
 
     size_t length = 0;
-    uint16_t* buffer = mp_flipper_infrared_receive(timeout, &length);
+    uint32_t* buffer = mp_flipper_infrared_receive(timeout, &length);
     mp_obj_t* signal = length > 0 ? malloc(length * sizeof(mp_obj_t)) : NULL;
 
     for(uint16_t i = 0; i < length; i++) {
-        if(buffer[i]) {
-            signal[i] = mp_obj_new_int(buffer[i]);
-        } else {
-            signal[i] = mp_obj_new_int(-1);
-        }
+        signal[i] = mp_obj_new_int(buffer[i]);
     }
 
     return mp_obj_new_list(length, signal);