Explorar o código

Play and pause icons

anfractuosity %!s(int64=2) %!d(string=hai) anos
pai
achega
77ee1e9357
Modificáronse 4 ficheiros con 7 adicións e 0 borrados
  1. 1 0
      application.fam
  2. BIN=BIN
      icons/pause_10x10.png
  3. BIN=BIN
      icons/play_10x10.png
  4. 6 0
      scenes/scope_scene_run.c

+ 1 - 0
application.fam

@@ -8,6 +8,7 @@ App(
     stack_size=1 * 1024,
     stack_size=1 * 1024,
     fap_category="GPIO",
     fap_category="GPIO",
     fap_icon="scope_10px.png",
     fap_icon="scope_10px.png",
+    fap_icon_assets="icons",
     fap_version="0.1",
     fap_version="0.1",
     fap_description="Oscilloscope application - apply signal to pin 16/PC0, with a voltage ranging from 0V to 2.5V and ground to pin 18/GND"
     fap_description="Oscilloscope application - apply signal to pin 16/PC0, with a voltage ranging from 0V to 2.5V and ground to pin 18/GND"
 )
 )

BIN=BIN
icons/pause_10x10.png


BIN=BIN
icons/play_10x10.png


+ 6 - 0
scenes/scope_scene_run.c

@@ -24,6 +24,7 @@
 #include "stm32wbxx_ll_gpio.h"
 #include "stm32wbxx_ll_gpio.h"
 
 
 #include "../scope_app_i.h"
 #include "../scope_app_i.h"
+#include "flipperscope_icons.h"
 
 
 #define DIGITAL_SCALE_12BITS ((uint32_t)0xFFF)
 #define DIGITAL_SCALE_12BITS ((uint32_t)0xFFF)
 #define ADC_CONVERTED_DATA_BUFFER_SIZE ((uint32_t)128)
 #define ADC_CONVERTED_DATA_BUFFER_SIZE ((uint32_t)128)
@@ -352,6 +353,11 @@ static void app_draw_callback(Canvas* canvas, void* ctx) {
     float min = FLT_MAX;
     float min = FLT_MAX;
     int count = 0;
     int count = 0;
 
 
+    if(pause)
+        canvas_draw_icon(canvas, 115, 0, &I_pause_10x10);
+    else
+        canvas_draw_icon(canvas, 115, 0, &I_play_10x10);
+
     // Calculate voltage measurements
     // Calculate voltage measurements
     for(uint32_t x = 0; x < ADC_CONVERTED_DATA_BUFFER_SIZE; x++) {
     for(uint32_t x = 0; x < ADC_CONVERTED_DATA_BUFFER_SIZE; x++) {
         if(mvoltDisplay[x] < min) min = mvoltDisplay[x];
         if(mvoltDisplay[x] < min) min = mvoltDisplay[x];