anfractuosity 2 лет назад
Родитель
Сommit
2741e8ea26
2 измененных файлов с 6 добавлено и 2 удалено
  1. 4 0
      scenes/scope_scene_run.c
  2. 2 2
      scope_app_i.h

+ 4 - 0
scenes/scope_scene_run.c

@@ -460,6 +460,10 @@ void scope_scene_run_on_enter(void* context) {
     // What type of measurement are we performing
     // What type of measurement are we performing
     type = app->measurement;
     type = app->measurement;
 
 
+    // Pause capture, when first started, if capturing
+    if(type == m_capture)
+        pause = 1;
+
     // Copy vector table, modify to use our own IRQ handlers
     // Copy vector table, modify to use our own IRQ handlers
     __disable_irq();
     __disable_irq();
     memcpy(ramVector, (uint32_t*)(FLASH_BASE | SCB->VTOR), sizeof(uint32_t) * TABLE_SIZE);
     memcpy(ramVector, (uint32_t*)(FLASH_BASE | SCB->VTOR), sizeof(uint32_t) * TABLE_SIZE);

+ 2 - 2
scope_app_i.h

@@ -21,14 +21,14 @@ typedef struct {
 static const timeperiod time_list[] =
 static const timeperiod time_list[] =
     {{1.0, "1s"}, {0.1, "0.1s"}, {1e-3, "1ms"}, {0.1e-3, "0.1ms"}, {1e-6, "1us"}};
     {{1.0, "1s"}, {0.1, "0.1s"}, {1e-3, "1ms"}, {0.1e-3, "0.1ms"}, {1e-6, "1us"}};
 
 
-enum measureenum { m_time, m_voltage };
+enum measureenum { m_time, m_voltage, m_capture };
 
 
 typedef struct {
 typedef struct {
     enum measureenum type;
     enum measureenum type;
     char* str;
     char* str;
 } measurement;
 } measurement;
 
 
-static const measurement measurement_list[] = {{m_time, "Time"}, {m_voltage, "Voltage"}};
+static const measurement measurement_list[] = {{m_time, "Time"}, {m_voltage, "Voltage"}, {m_capture, "Capture"}};
 
 
 struct ScopeApp {
 struct ScopeApp {
     Gui* gui;
     Gui* gui;