3 #if defined(PLATFORM_ESP32) && defined(TARGET_RX)
4 #include "devSerialUpdate.h"
11 extern void start_esp_upload();
12 extern void stub_handle_rx_byte(char byte
);
14 static bool running
= false;
16 static bool initialize()
24 if (connectionState
== serialUpdate
&& running
)
30 POWERMGNT::setPower(MinPower
);
32 return DURATION_IMMEDIATELY
;
34 return DURATION_NEVER
;
43 int count
= Serial
.read(buf
, sizeof(buf
));
44 for (int i
=0 ; i
<count
; i
++)
46 stub_handle_rx_byte(buf
[i
]);
51 device_t SerialUpdate_device
= {
52 .initialize
= initialize
,
56 .subscribe
= EVENT_CONNECTION_CHANGED