theageoflove %!s(int64=3) %!d(string=hai) anos
pai
achega
4287b114c5
Modificáronse 2 ficheiros con 13 adicións e 1 borrados
  1. 13 1
      zeitraffer.c
  2. BIN=BIN
      zeitraffer.png

+ 13 - 1
zeitraffer.c

@@ -1,8 +1,10 @@
 #include <stdio.h>
 #include <stdio.h>
 #include <furi.h>
 #include <furi.h>
+#include <../../applications/main/gpio/gpio_item.h>
 #include <gui/gui.h>
 #include <gui/gui.h>
 #include <input/input.h>
 #include <input/input.h>
 #include <notification/notification_messages.h>
 #include <notification/notification_messages.h>
+
 //#include <notification/notification_messages_notes.h>
 //#include <notification/notification_messages_notes.h>
 
 
 int Time = 10;
 int Time = 10;
@@ -77,6 +79,8 @@ int32_t zeitraffer_app(void* p) {
     // Подключаем view port к GUI в полноэкранном режиме
     // Подключаем view port к GUI в полноэкранном режиме
     gui_add_view_port(gui, view_port, GuiLayerFullscreen);
     gui_add_view_port(gui, view_port, GuiLayerFullscreen);
 
 
+	gpio_item_configure_all_pins(GpioModeOutputPushPull);
+
     // Создаем периодический таймер с коллбэком, куда в качестве
     // Создаем периодический таймер с коллбэком, куда в качестве
     // контекста будет передаваться наша очередь событий
     // контекста будет передаваться наша очередь событий
     FuriTimer* timer = furi_timer_alloc(timer_callback, FuriTimerTypePeriodic, event_queue);
     FuriTimer* timer = furi_timer_alloc(timer_callback, FuriTimerTypePeriodic, event_queue);
@@ -177,14 +181,22 @@ int32_t zeitraffer_app(void* p) {
 			WorkTime--;
 			WorkTime--;
 			notification_message(notifications, &sequence_blink_blue_100);
 			notification_message(notifications, &sequence_blink_blue_100);
             if( WorkTime < 1 ) {
             if( WorkTime < 1 ) {
-
 				WorkCount--;
 				WorkCount--;
+				view_port_update(view_port);
+				gpio_item_set_all_pins(true);
+				//gpio_item_set_pin(6, true);
+				furi_delay_ms(300);
+				//gpio_item_set_pin(6, false);
+				gpio_item_set_all_pins(false);
+
 				if (InfiniteShot) WorkCount++;
 				if (InfiniteShot) WorkCount++;
 				notification_message(notifications, &sequence_click);
 				notification_message(notifications, &sequence_click);
 				WorkTime = Time;
 				WorkTime = Time;
+				view_port_update(view_port);
 				
 				
 			}
 			}
 			if( WorkCount < 1 ) { 
 			if( WorkCount < 1 ) { 
+				gpio_item_set_all_pins(false);
 				furi_timer_stop(timer); 
 				furi_timer_stop(timer); 
 				notification_message(notifications, &sequence_audiovisual_alert);
 				notification_message(notifications, &sequence_audiovisual_alert);
 				WorkTime = 3;
 				WorkTime = 3;

BIN=BIN
zeitraffer.png