Просмотр исходного кода

Merge oscilloscope from https://github.com/anfractuosity/flipperscope

# Conflicts:
#	oscilloscope/application.fam
#	oscilloscope/scenes/scope_scene_run.c
Willy-JL 1 год назад
Родитель
Сommit
a54304c73a

+ 1 - 1
oscilloscope/application.fam

@@ -9,6 +9,6 @@ App(
     fap_category="GPIO",
     fap_icon="scope_10px.png",
     fap_icon_assets="icons",
-    fap_version="0.2",
+    fap_version="0.3",
     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",
 )

+ 4 - 0
oscilloscope/docs/CHANGELOG.md

@@ -1,3 +1,7 @@
+## v0.3
+
+Fix compilation issue
+
 ## v0.2
 
 Small bug fixes and initial support for saving captures

+ 1 - 1
oscilloscope/docs/README.md

@@ -4,7 +4,7 @@ Oscilloscope application - apply signal to pin 16/PC0, with a voltage ranging fr
 
 ## Guide
 
-**Center** = Pause/Un-pause display
+* **Center** = Pause/Un-pause display
 
 * In the setup screen you specify a time period of the analogue to digital converter, so 1ms, means sampling at 1000Hz.
 

+ 6 - 5
oscilloscope/scenes/scope_scene_run.c

@@ -27,6 +27,7 @@
 #include "../scope_app_i.h"
 #include "flipperscope_icons.h"
 
+#define USE_TIMEOUT                          0
 #define DIGITAL_SCALE_12BITS                 ((uint32_t)0xFFF)
 #define VAR_CONVERTED_DATA_INIT_VALUE        (DIGITAL_SCALE_12BITS + 1)
 #define VAR_CONVERTED_DATA_INIT_VALUE_16BITS (0xFFFF + 1U)
@@ -294,7 +295,7 @@ void AdcDmaTransferHalf_Callback() {
 
 void Activate_ADC(void) {
     __IO uint32_t wait_loop_index = 0U;
-#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
+#if(USE_TIMEOUT == 1)
     uint32_t Timeout = 0U; /* Variable used for timeout management */
 #endif /* USE_TIMEOUT */
     if(LL_ADC_IsEnabled(ADC1) == 0) {
@@ -307,12 +308,12 @@ void Activate_ADC(void) {
         }
         LL_ADC_StartCalibration(ADC1, LL_ADC_SINGLE_ENDED);
 
-#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
+#if(USE_TIMEOUT == 1)
         Timeout = ADC_CALIBRATION_TIMEOUT_MS;
 #endif /* USE_TIMEOUT */
 
         while(LL_ADC_IsCalibrationOnGoing(ADC1) != 0) {
-#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
+#if(USE_TIMEOUT == 1)
             if(LL_SYSTICK_IsActiveCounterFlag()) {
                 if(Timeout-- == 0) {
                 }
@@ -324,11 +325,11 @@ void Activate_ADC(void) {
             wait_loop_index--;
         }
         LL_ADC_Enable(ADC1);
-#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
+#if(USE_TIMEOUT == 1)
         Timeout = ADC_ENABLE_TIMEOUT_MS;
 #endif /* USE_TIMEOUT */
         while(LL_ADC_IsActiveFlag_ADRDY(ADC1) == 0) {
-#if defined(USE_TIMEOUT) && (USE_TIMEOUT == 1)
+#if(USE_TIMEOUT == 1)
             /* Check Systick counter flag to decrement the time-out value */
             if(LL_SYSTICK_IsActiveCounterFlag()) {
                 if(Timeout-- == 0) {