-
-
Notifications
You must be signed in to change notification settings - Fork 35
Firmware mode
Erwin Ried edited this page Feb 26, 2023
·
2 revisions
To switch between modes (i.e. serial output raw from camera, qr codes, others), everytime the ESP32 board is reset it waits for few milliseconds for a character that defines which mode:
while (waitForStreamMode > millis()) {
if (Serial.available()) // if we receive anything, just switch to another mode
{
switch (Serial.read()) {
case 'q': // QR code reader mode
qr_reader_setup();
for (;;)
qr_reader_loop();
case 'm': // Motion detection
motion_detection_setup();
for (;;)
motion_detection_loop();
...
Check esp32cam_marauder.ino file for the actual code. This makes switching mode easy in the Flipper fap, turning off and on the otg power and sending the corresponding char
for which mode we want to use in the app:
furi_hal_power_disable_otg();
furi_delay_ms(200);
furi_hal_power_enable_otg();
furi_delay_ms(500);
furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t[1]){'q'}, 1);
...
Check the companion apps for the actual code.
Note
The wiki is yet to be completed. Please feel free to add content and collaborate.
Important
This is a public wiki. Everything you write here will be public and everyone can see it. So please don't take your personal notes here.