diff --git a/applications/plugins/timelapse/zeitraffer.c b/applications/plugins/timelapse/zeitraffer.c index 41bb6bd84..3f68745ea 100644 --- a/applications/plugins/timelapse/zeitraffer.c +++ b/applications/plugins/timelapse/zeitraffer.c @@ -34,34 +34,33 @@ typedef struct { static void draw_callback(Canvas* canvas, void* ctx) { UNUSED(ctx); - char temp_str[36]; + char temp_str[36]; canvas_clear(canvas); canvas_set_font(canvas, FontPrimary); - switch (Count) { - case -1: - snprintf(temp_str,sizeof(temp_str),"Set: BULB %i sec",Time); - break; - case 0: - snprintf(temp_str,sizeof(temp_str),"Set: infinite, %i sec",Time); - break; - default: - snprintf(temp_str,sizeof(temp_str),"Set: %i frames, %i sec",Count,Time); - } - canvas_draw_str(canvas, 3, 15, temp_str); - snprintf(temp_str,sizeof(temp_str),"Left: %i frames, %i sec",WorkCount,WorkTime); - canvas_draw_str(canvas, 3, 35, temp_str); - - switch (Backlight) { - case 1: - canvas_draw_str(canvas, 3, 55, "Backlight: ON"); - break; - case 2: - canvas_draw_str(canvas, 3, 55, "Backlight: OFF"); - break; - default: - canvas_draw_str(canvas, 3, 55, "Backlight: AUTO"); - } + switch(Count) { + case -1: + snprintf(temp_str, sizeof(temp_str), "Set: BULB %i sec", Time); + break; + case 0: + snprintf(temp_str, sizeof(temp_str), "Set: infinite, %i sec", Time); + break; + default: + snprintf(temp_str, sizeof(temp_str), "Set: %i frames, %i sec", Count, Time); + } + canvas_draw_str(canvas, 3, 15, temp_str); + snprintf(temp_str, sizeof(temp_str), "Left: %i frames, %i sec", WorkCount, WorkTime); + canvas_draw_str(canvas, 3, 35, temp_str); + switch(Backlight) { + case 1: + canvas_draw_str(canvas, 3, 55, "Backlight: ON"); + break; + case 2: + canvas_draw_str(canvas, 3, 55, "Backlight: OFF"); + break; + default: + canvas_draw_str(canvas, 3, 55, "Backlight: AUTO"); + } } static void input_callback(InputEvent* input_event, void* ctx) { @@ -83,7 +82,7 @@ static void timer_callback(FuriMessageQueue* event_queue) { int32_t zeitraffer_app(void* p) { UNUSED(p); - + // Текущее событие типа кастомного типа ZeitrafferEvent ZeitrafferEvent event; // Очередь событий на 8 элементов размера ZeitrafferEvent @@ -101,9 +100,9 @@ int32_t zeitraffer_app(void* p) { Gui* gui = furi_record_open(RECORD_GUI); // Подключаем view port к GUI в полноэкранном режиме gui_add_view_port(gui, view_port, GuiLayerFullscreen); - - // Конфигурим пины - gpio_item_configure_all_pins(GpioModeOutputPushPull); + + // Конфигурим пины + gpio_item_configure_all_pins(GpioModeOutputPushPull); // Создаем периодический таймер с коллбэком, куда в качестве // контекста будет передаваться наша очередь событий @@ -120,214 +119,196 @@ int32_t zeitraffer_app(void* p) { // и проверяем, что у нас получилось это сделать furi_check(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk); - // Наше событие — это нажатие кнопки - if(event.type == EventTypeInput) { - if(event.input.type == InputTypeShort) { // Короткие нажатия - - if(event.input.key == InputKeyBack) { - if(furi_timer_is_running(timer)) { // Если таймер запущен - нефиг мацать кнопки! - notification_message(notifications, &sequence_error); - } - else { - WorkCount = Count; - WorkTime = 3; - if (Count == 0) { - InfiniteShot = true; - WorkCount = 1; - } - else - InfiniteShot = false; - - notification_message(notifications, &sequence_success); - } - } - if(event.input.key == InputKeyRight) { - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_error); - } - else { - Count++; - notification_message(notifications, &sequence_click); - } - } - if(event.input.key == InputKeyLeft) { - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_error); - } - else { - Count--; - notification_message(notifications, &sequence_click); - } - } - if(event.input.key == InputKeyUp) { - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_error); - } - else { - Time++; - notification_message(notifications, &sequence_click); - } - } - if(event.input.key == InputKeyDown) { - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_error); - } - else { - Time--; - notification_message(notifications, &sequence_click); - } - } - if(event.input.key == InputKeyOk) { - - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_click); - furi_timer_stop(timer); - } - else { - furi_timer_start(timer, 1000); - - if (WorkCount == 0) - WorkCount = Count; - - if (WorkTime == 0) - WorkTime = 3; - - if (Count == 0) { - InfiniteShot = true; - WorkCount = 1; - } - else - InfiniteShot = false; - - if (Count == -1) { - gpio_item_set_pin(4, true); - gpio_item_set_pin(5, true); - Bulb = true; - WorkCount = 1; - WorkTime = Time; - } - else - Bulb = false; - - notification_message(notifications, &sequence_success); - } - } - } - if(event.input.type == InputTypeLong) { // Длинные нажатия - // Если нажата кнопка "назад", то выходим из цикла, а следовательно и из приложения - if(event.input.key == InputKeyBack) { - if(furi_timer_is_running(timer)) { // А если работает таймер - не выходим :D - notification_message(notifications, &sequence_error); - } - else { - notification_message(notifications, &sequence_click); - gpio_item_set_all_pins(false); - furi_timer_stop(timer); - notification_message(notifications, &sequence_display_backlight_enforce_auto); - break; - } - } - if(event.input.key == InputKeyOk) { - // Нам ваша подсветка и нахой не нужна! Или нужна? - Backlight++; - if (Backlight > 2) Backlight = 0; - } + // Наше событие — это нажатие кнопки + if(event.type == EventTypeInput) { + if(event.input.type == InputTypeShort) { // Короткие нажатия - } + if(event.input.key == InputKeyBack) { + if(furi_timer_is_running( + timer)) { // Если таймер запущен - нефиг мацать кнопки! + notification_message(notifications, &sequence_error); + } else { + WorkCount = Count; + WorkTime = 3; + if(Count == 0) { + InfiniteShot = true; + WorkCount = 1; + } else + InfiniteShot = false; - if(event.input.type == InputTypeRepeat) { // Зажатые кнопки - if(event.input.key == InputKeyRight) { - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_error); - } - else { - Count = Count+10; - } - } - if(event.input.key == InputKeyLeft) { - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_error); - } - else { - Count = Count-10; - } - } - if(event.input.key == InputKeyUp) { - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_error); - } - else { - Time = Time+10; - } - } - if(event.input.key == InputKeyDown) { - if(furi_timer_is_running(timer)) { - notification_message(notifications, &sequence_error); - } - else { - Time = Time-10; - } - } - } + notification_message(notifications, &sequence_success); + } + } + if(event.input.key == InputKeyRight) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_error); + } else { + Count++; + notification_message(notifications, &sequence_click); + } + } + if(event.input.key == InputKeyLeft) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_error); + } else { + Count--; + notification_message(notifications, &sequence_click); + } + } + if(event.input.key == InputKeyUp) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_error); + } else { + Time++; + notification_message(notifications, &sequence_click); + } + } + if(event.input.key == InputKeyDown) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_error); + } else { + Time--; + notification_message(notifications, &sequence_click); + } + } + if(event.input.key == InputKeyOk) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_click); + furi_timer_stop(timer); + } else { + furi_timer_start(timer, 1000); + + if(WorkCount == 0) WorkCount = Count; + + if(WorkTime == 0) WorkTime = 3; + + if(Count == 0) { + InfiniteShot = true; + WorkCount = 1; + } else + InfiniteShot = false; + + if(Count == -1) { + gpio_item_set_pin(4, true); + gpio_item_set_pin(5, true); + Bulb = true; + WorkCount = 1; + WorkTime = Time; + } else + Bulb = false; + + notification_message(notifications, &sequence_success); + } + } + } + if(event.input.type == InputTypeLong) { // Длинные нажатия + // Если нажата кнопка "назад", то выходим из цикла, а следовательно и из приложения + if(event.input.key == InputKeyBack) { + if(furi_timer_is_running(timer)) { // А если работает таймер - не выходим :D + notification_message(notifications, &sequence_error); + } else { + notification_message(notifications, &sequence_click); + gpio_item_set_all_pins(false); + furi_timer_stop(timer); + notification_message( + notifications, &sequence_display_backlight_enforce_auto); + break; + } + } + if(event.input.key == InputKeyOk) { + // Нам ваша подсветка и нахой не нужна! Или нужна? + Backlight++; + if(Backlight > 2) Backlight = 0; + } + } + + if(event.input.type == InputTypeRepeat) { // Зажатые кнопки + if(event.input.key == InputKeyRight) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_error); + } else { + Count = Count + 10; + } + } + if(event.input.key == InputKeyLeft) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_error); + } else { + Count = Count - 10; + } + } + if(event.input.key == InputKeyUp) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_error); + } else { + Time = Time + 10; + } + } + if(event.input.key == InputKeyDown) { + if(furi_timer_is_running(timer)) { + notification_message(notifications, &sequence_error); + } else { + Time = Time - 10; + } + } + } } - + // Наше событие — это сработавший таймер - else if(event.type == EventTypeTick) { - - WorkTime--; - - if( WorkTime < 1 ) { // фоткаем - notification_message(notifications, &sequence_blink_white_100); - if (Bulb) { - gpio_item_set_all_pins(false); WorkCount = 0; - } - else { - WorkCount--; - view_port_update(view_port); - notification_message(notifications, &sequence_click); - // Дрыгаем ногами - //gpio_item_set_all_pins(true); - gpio_item_set_pin(4, true); - gpio_item_set_pin(5, true); - furi_delay_ms(400); // На короткие нажатия фотик плохо реагирует - gpio_item_set_pin(4, false); - gpio_item_set_pin(5, false); - //gpio_item_set_all_pins(false); + else if(event.type == EventTypeTick) { + WorkTime--; - if (InfiniteShot) WorkCount++; - - WorkTime = Time; - view_port_update(view_port); - } - } - else { - // Отправляем нотификацию мигания синим светодиодом - notification_message(notifications, &sequence_blink_blue_100); - } - - if( WorkCount < 1 ) { // закончили - gpio_item_set_all_pins(false); - furi_timer_stop(timer); - notification_message(notifications, &sequence_audiovisual_alert); - WorkTime = 3; - WorkCount = 0; - } - - switch (Backlight) { // чо по подсветке? - case 1: - notification_message(notifications, &sequence_display_backlight_on); - break; - case 2: - notification_message(notifications, &sequence_display_backlight_off); - break; - default: - notification_message(notifications, &sequence_display_backlight_enforce_auto); - } - + if(WorkTime < 1) { // фоткаем + notification_message(notifications, &sequence_blink_white_100); + if(Bulb) { + gpio_item_set_all_pins(false); + WorkCount = 0; + } else { + WorkCount--; + view_port_update(view_port); + notification_message(notifications, &sequence_click); + // Дрыгаем ногами + //gpio_item_set_all_pins(true); + gpio_item_set_pin(4, true); + gpio_item_set_pin(5, true); + furi_delay_ms(400); // На короткие нажатия фотик плохо реагирует + gpio_item_set_pin(4, false); + gpio_item_set_pin(5, false); + //gpio_item_set_all_pins(false); + + if(InfiniteShot) WorkCount++; + + WorkTime = Time; + view_port_update(view_port); + } + } else { + // Отправляем нотификацию мигания синим светодиодом + notification_message(notifications, &sequence_blink_blue_100); + } + + if(WorkCount < 1) { // закончили + gpio_item_set_all_pins(false); + furi_timer_stop(timer); + notification_message(notifications, &sequence_audiovisual_alert); + WorkTime = 3; + WorkCount = 0; + } + + switch(Backlight) { // чо по подсветке? + case 1: + notification_message(notifications, &sequence_display_backlight_on); + break; + case 2: + notification_message(notifications, &sequence_display_backlight_off); + break; + default: + notification_message(notifications, &sequence_display_backlight_enforce_auto); + } } - if (Time < 1) Time = 1; // Не даём открутить таймер меньше единицы - if (Count < -1) Count = 0; // А тут даём, бо 0 кадров это бесконечная съёмка, а -1 кадров - BULB - } + if(Time < 1) Time = 1; // Не даём открутить таймер меньше единицы + if(Count < -1) + Count = 0; // А тут даём, бо 0 кадров это бесконечная съёмка, а -1 кадров - BULB + } // Очищаем таймер furi_timer_free(timer); diff --git a/applications/plugins/usb_hid_autofire/usb_hid_autofire.c b/applications/plugins/usb_hid_autofire/usb_hid_autofire.c index 34c1fa413..2e7a096d9 100644 --- a/applications/plugins/usb_hid_autofire/usb_hid_autofire.c +++ b/applications/plugins/usb_hid_autofire/usb_hid_autofire.c @@ -86,9 +86,9 @@ int32_t usb_hid_autofire_app(void* p) { if(btn_left_autofire) { furi_hal_hid_mouse_press(HID_MOUSE_BTN_LEFT); -// wait(100); + // wait(100); furi_hal_hid_mouse_release(HID_MOUSE_BTN_LEFT); -// wait(100); + // wait(100); } view_port_update(view_port); diff --git a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c index 136f66f80..029614c5d 100644 --- a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c +++ b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_start.c @@ -60,7 +60,15 @@ const WifiMarauderItem items[NUM_MENU_ITEMS] = { {"Sniff", {"beacon", "deauth", "esp", "pmkid", "probe", "pwn", "raw", "bt", "skim"}, 9, - {"sniffbeacon", "sniffdeauth", "sniffesp", "sniffpmkid", "sniffprobe", "sniffpwn", "sniffraw", "sniffbt", "sniffskim"}, + {"sniffbeacon", + "sniffdeauth", + "sniffesp", + "sniffpmkid", + "sniffprobe", + "sniffpwn", + "sniffraw", + "sniffbt", + "sniffskim"}, NO_ARGS, FOCUS_CONSOLE_END, SHOW_STOPSCAN_TIP}, diff --git a/buildRelease.sh b/buildRelease.sh index 62892e786..1190e2b5d 100755 --- a/buildRelease.sh +++ b/buildRelease.sh @@ -1,3 +1,4 @@ +rm -rf RM*-*-*.tgz RM*-*-*.zip .sconsign.dblite dist build assets/resources/apps git pull ./fbt updater_package DATE_VAR=`date +%m%d`