mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-07 19:01:54 -07:00
fix: gpio pins reset to default state, see desc.
fixed wrong text in wifi deauther fixed hc sr04 gpio other fixes
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#define DEAUTH_APP_DEBUG 0
|
||||
|
||||
#if DEAUTH_APP_DEBUG
|
||||
#define APP_NAME_TAG "WiFi_Scanner"
|
||||
#define APP_NAME_TAG "WiFi_Deauther"
|
||||
#define DEAUTH_APP_LOG_I(format, ...) FURI_LOG_I(APP_NAME_TAG, format, ##__VA_ARGS__)
|
||||
#define DEAUTH_APP_LOG_D(format, ...) FURI_LOG_D(APP_NAME_TAG, format, ##__VA_ARGS__)
|
||||
#define DEAUTH_APP_LOG_E(format, ...) FURI_LOG_E(APP_NAME_TAG, format, ##__VA_ARGS__)
|
||||
@@ -167,7 +167,7 @@ static void esp8266_deauth_module_render_callback(Canvas* const canvas, void* ct
|
||||
canvas_clear(canvas);
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
|
||||
const char* strInitializing = "Attach WiFi scanner module";
|
||||
const char* strInitializing = "Attach WiFi Deauther module";
|
||||
canvas_draw_str(
|
||||
canvas,
|
||||
(u8g2_GetDisplayWidth(&canvas->fb) / 2) -
|
||||
@@ -472,8 +472,6 @@ int32_t esp8266_deauth_app(void* p) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DEAUTH_APP_LOG_D("osMessageQueue: event timeout");
|
||||
}
|
||||
|
||||
#if ENABLE_MODULE_DETECTION
|
||||
@@ -497,6 +495,13 @@ int32_t esp8266_deauth_app(void* p) {
|
||||
|
||||
DEAUTH_APP_LOG_I("Thread Deleted");
|
||||
|
||||
// Reset GPIO pins to default state
|
||||
furi_hal_gpio_init(&gpio_ext_pc0, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
furi_hal_gpio_init(&gpio_ext_pc3, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
furi_hal_gpio_init(&gpio_ext_pb2, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
furi_hal_gpio_init(&gpio_ext_pb3, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
furi_hal_gpio_init(&gpio_ext_pa4, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
|
||||
#if DISABLE_CONSOLE
|
||||
furi_hal_console_enable();
|
||||
#endif
|
||||
|
||||
@@ -639,6 +639,9 @@ int32_t i2ctools_app(void* p) {
|
||||
}
|
||||
view_port_update(i2caddrs->view_port);
|
||||
}
|
||||
// Reset GPIO pins to default state
|
||||
furi_hal_gpio_init(&gpio_ext_pc0, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
furi_hal_gpio_init(&gpio_ext_pc1, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
gui_remove_view_port(gui, i2caddrs->view_port);
|
||||
view_port_free(i2caddrs->view_port);
|
||||
furi_message_queue_free(event_queue);
|
||||
|
||||
@@ -181,12 +181,15 @@ int32_t hc_sr04_app() {
|
||||
|
||||
hc_sr04_state_init(plugin_state);
|
||||
|
||||
furi_hal_console_disable();
|
||||
|
||||
ValueMutex state_mutex;
|
||||
if(!init_mutex(&state_mutex, plugin_state, sizeof(PluginState))) {
|
||||
FURI_LOG_E("hc_sr04", "cannot create mutex\r\n");
|
||||
if(furi_hal_power_is_otg_enabled()) {
|
||||
furi_hal_power_disable_otg();
|
||||
}
|
||||
furi_hal_console_enable();
|
||||
furi_hal_power_suppress_charge_exit();
|
||||
furi_message_queue_free(event_queue);
|
||||
free(plugin_state);
|
||||
@@ -239,6 +242,22 @@ int32_t hc_sr04_app() {
|
||||
furi_hal_power_disable_otg();
|
||||
}
|
||||
furi_hal_power_suppress_charge_exit();
|
||||
|
||||
// Return TX / RX back to usart mode
|
||||
furi_hal_gpio_init_ex(
|
||||
&gpio_usart_tx,
|
||||
GpioModeAltFunctionPushPull,
|
||||
GpioPullUp,
|
||||
GpioSpeedVeryHigh,
|
||||
GpioAltFn7USART1);
|
||||
furi_hal_gpio_init_ex(
|
||||
&gpio_usart_rx,
|
||||
GpioModeAltFunctionPushPull,
|
||||
GpioPullUp,
|
||||
GpioSpeedVeryHigh,
|
||||
GpioAltFn7USART1);
|
||||
furi_hal_console_enable();
|
||||
|
||||
view_port_enabled_set(view_port, false);
|
||||
gui_remove_view_port(gui, view_port);
|
||||
furi_record_close(RECORD_GUI);
|
||||
|
||||
@@ -146,14 +146,15 @@ int32_t sentry_safe_app(void* p) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// event timeout
|
||||
}
|
||||
|
||||
view_port_update(view_port);
|
||||
release_mutex(&state_mutex, sentry_state);
|
||||
}
|
||||
|
||||
// Reset GPIO pins to default state
|
||||
furi_hal_gpio_init(&gpio_ext_pc1, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
|
||||
view_port_enabled_set(view_port, false);
|
||||
gui_remove_view_port(gui, view_port);
|
||||
furi_record_close(RECORD_GUI);
|
||||
|
||||
@@ -795,8 +795,6 @@ int32_t wifi_scanner_app(void* p) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
WIFI_APP_LOG_D("osMessageQueue: event timeout");
|
||||
}
|
||||
|
||||
#if ENABLE_MODULE_DETECTION
|
||||
@@ -820,6 +818,9 @@ int32_t wifi_scanner_app(void* p) {
|
||||
|
||||
WIFI_APP_LOG_I("Thread Deleted");
|
||||
|
||||
// Reset GPIO pins to default state
|
||||
furi_hal_gpio_init(&gpio_ext_pc0, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
|
||||
#if DISABLE_CONSOLE
|
||||
furi_hal_console_enable();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user