Skip to content

Commit ff79acb

Browse files
committed
Unifi App and module firmware to support FlipperZero's Dev Module v.1
1 parent 0b2cdb6 commit ff79acb

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

FlipperZero-WiFi-Scanner-App/applications/wifi_scanner/wifi_scanner.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#include "FlipperZeroWiFiModuleDefines.h"
1818

19-
#define FLIPPERZERO_DEV_BOARD_V_1 0
20-
2119
#define WIFI_APP_DEBUG 0
2220

2321
#if WIFI_APP_DEBUG
@@ -33,13 +31,8 @@
3331

3432
#define DISABLE_CONSOLE !WIFI_APP_DEBUG
3533

36-
#if FLIPPERZERO_DEV_BOARD_V_1
37-
#define ENABLE_MODULE_POWER 0
38-
#define ENABLE_MODULE_DETECTION 0
39-
#else
4034
#define ENABLE_MODULE_POWER 1
4135
#define ENABLE_MODULE_DETECTION 1
42-
#endif
4336

4437

4538
#define ANIMATION_TIME 350
@@ -504,14 +497,14 @@ static int32_t uart_worker(void* context) {
504497
return 1;
505498
}
506499

507-
508500
if (!app->m_wifiModuleInitialized)
509501
{
510502
if (string_cmp_str(chunksArray[EChunkArrayData_Context], MODULE_CONTEXT_INITIALIZATION) == 0)
511503
{
512504
app->m_wifiModuleInitialized = true;
513505
app->m_context = ScanAnimation;
514506
}
507+
515508
}
516509
else
517510
{
@@ -667,10 +660,8 @@ int32_t wifi_scanner_app(void* p)
667660
furi_thread_start(app->m_worker_thread);
668661
WIFI_APP_LOG_I("UART thread allocated");
669662

670-
#if !ENABLE_MODULE_POWER
671663
// Because we assume that module was on before we launched the app. We need to ensure that module will be in initial state on app start
672664
send_serial_command(ESerialCommand_Restart);
673-
#endif // ENABLE_MODULE_POWER
674665

675666
SPluginEvent event;
676667
for(bool processing = true; processing;)
@@ -779,7 +770,7 @@ int32_t wifi_scanner_app(void* p)
779770
{
780771
if(event.m_input.key == InputKeyBack)
781772
{
782-
if(event.m_input.type == InputTypeShort || event.m_input.type == InputTypeLong) //event.input.type == InputTypePress)
773+
if(event.m_input.type == InputTypeShort || event.m_input.type == InputTypeLong)
783774
{
784775
processing = false;
785776
}

FlipperZero-WiFi-Scanner_Module/FlipperZero-WiFi-Scanner_Module.ino

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#include "DebugHelpers.h"
1111
#include "FlipperZeroWiFiModuleDefines.h"
1212

13+
#if FLIPPERZERO_DEV_BOARD_V_1 && !ESP32
14+
Please_choose_ESP32S2_Dev_Module_from_Board_Manager
15+
#endif
16+
17+
1318
const uint16_t ASSOCIATIVE_INDEX_ARRAY_MAX_ELEMENTS = UCHAR_MAX + 1;
1419
uint8_t g_associativeIndexArray[ASSOCIATIVE_INDEX_ARRAY_MAX_ELEMENTS];
1520

@@ -234,6 +239,11 @@ void ScanMode()
234239
}
235240

236241
void setup() {
242+
#if ESP32 // For FlipperZero's Dev Module v.1
243+
pinMode(17, OUTPUT);
244+
digitalWrite(17, false);
245+
#endif
246+
237247
Serial.begin(FLIPPERZERO_SERIAL_BAUD);
238248
while (!Serial) {
239249
; // wait for serial port to connect

0 commit comments

Comments
 (0)