-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
167 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* SimpleDSO.cpp | ||
* SimpleDSO_BlueDisplay.cpp | ||
* | ||
* Copyright (C) 2015-2023 Armin Joachimsmeyer | ||
* Email: [email protected] | ||
|
@@ -172,10 +172,11 @@ | |
#endif | ||
#include "BlueDisplay.hpp" | ||
|
||
#include "SimpleDSO.h" | ||
#include "SimpleDSO_BlueDisplay.h" | ||
#include "LocalDisplay/digitalWriteFast.h" | ||
#include "FrequencyGeneratorPage.hpp" // include sources | ||
#include "TouchDSOGui.hpp" // include sources | ||
#include "ADCUtils.hpp" // for getVCCVoltage() | ||
|
||
/********************** | ||
* Buttons | ||
|
@@ -258,7 +259,7 @@ extern volatile unsigned long timer0_millis; | |
*/ | ||
#define TRIGGER_WAIT_NUMBER_OF_SAMPLES 3300 // Number of samples (<=112us) used for detecting the trigger condition | ||
#define ADC_CYCLES_PER_CONVERSION 13 | ||
#define SCALE_CHANGE_DELAY_MILLIS 2000 | ||
#define RANGE_CHANGE_DELAY_MILLIS 2000 | ||
|
||
#define ADC_MAX_CONVERSION_VALUE (1024 -1) // 10 bit | ||
#define ATTENUATOR_FACTOR 10 | ||
|
@@ -348,7 +349,6 @@ void clearDisplayedChart(uint8_t *aDisplayBufferPtr); | |
void drawRemainingDataBufferValues(void); | ||
|
||
//Hardware support section | ||
float getTemperature(void); | ||
void setVCCValue(void); | ||
inline void setPrescaleFactor(uint8_t aFactor); | ||
void setADCReferenceShifted(uint8_t aReferenceShifted); | ||
|
@@ -521,7 +521,7 @@ void setup() { | |
/************************************************************************ | ||
* main loop - 32 microseconds | ||
************************************************************************/ | ||
// noreturn saves 56 byte program memory! | ||
// noreturn saves 56 byte program memory! but no stack | ||
void __attribute__((noreturn)) loop(void) { | ||
uint32_t sMillisOfLastInfoOutput; | ||
|
||
|
@@ -583,7 +583,7 @@ void __attribute__((noreturn)) loop(void) { | |
} else if (DisplayControl.DisplayPage == DSO_PAGE_FREQUENCY) { | ||
// refresh buttons | ||
drawFrequencyGeneratorPage(); | ||
#if !defined(AVR) | ||
#if !defined(__AVR__) | ||
} else if (DisplayControl.DisplayPage == DSO_PAGE_MORE_SETTINGS) { | ||
// refresh buttons | ||
drawDSOMoreSettingsPage(); | ||
|
@@ -1536,7 +1536,7 @@ void computeAutoRange(void) { | |
* wait n-milliseconds before switch to higher resolution (lower index) | ||
*/ | ||
uint32_t tActualMillis = millis(); | ||
if (tActualMillis - MeasurementControl.TimestampLastRangeChange > SCALE_CHANGE_DELAY_MILLIS) { | ||
if (tActualMillis - MeasurementControl.TimestampLastRangeChange > RANGE_CHANGE_DELAY_MILLIS) { | ||
MeasurementControl.TimestampLastRangeChange = tActualMillis; | ||
setInputRange(tNewValueShift, tNewAttenuatorValue); | ||
} | ||
|
@@ -2026,7 +2026,7 @@ void printInfo(bool aRecomputeValues) { | |
getFloatFromRawValue(MeasurementControl.RawValueAverage), tPrecision, getFloatFromRawValue(tValueDiff), | ||
tBufferForPeriodAndFrequency, tUnitsPerGrid, tTimebaseUnitChar); | ||
#else | ||
#if defined(AVR) | ||
#if defined(__AVR__) | ||
|
||
sprintf_P(sStringBuffer, PSTR("%sV %sV %5luHz %3u%cs"), tAverageStringBuffer, tP2PStringBuffer, tHertz, | ||
tTimebaseUnitsPerGrid, tTimebaseUnitChar); | ||
|
@@ -2101,7 +2101,7 @@ void printTriggerInfo(void) { | |
*/ | ||
void printVCCAndTemperature(void) { | ||
if (!MeasurementControl.isRunning) { | ||
float tTemp = getTemperature(); | ||
float tTemp = getCPUTemperature(); | ||
dtostrf(tTemp, 4, 1, &sStringBuffer[40]); | ||
|
||
setVCCValue(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* SimpleDSO.h | ||
* SimpleDSO_BlueDisplay.h | ||
* | ||
* Copyright (C) 2015-2023 Armin Joachimsmeyer | ||
* Email: [email protected] | ||
|
@@ -20,8 +20,8 @@ | |
* along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>. | ||
*/ | ||
|
||
#ifndef _SIMPLE_TOUCHSCREEN_DSO_H | ||
#define _SIMPLE_TOUCHSCREEN_DSO_H | ||
#ifndef _SIMPLE_DSO_BLUEDISPLAY_H | ||
#define _SIMPLE_DSO_BLUEDISPLAY_H | ||
|
||
#include "TouchDSOCommon.h" | ||
|
||
|
@@ -245,7 +245,7 @@ void clearSingleshotMarker(); | |
extern "C" void INT0_vect(); | ||
|
||
// for printf etc. | ||
#if defined(AVR) | ||
#if defined(__AVR__) | ||
#define SIZEOF_STRINGBUFFER 50 | ||
#else | ||
#define SIZEOF_STRINGBUFFER 240 | ||
|
@@ -256,4 +256,4 @@ extern BDButton TouchButtonBack; | |
// global flag for page control. Is evaluated by calling loop or page and set by buttonBack handler | ||
extern bool sBackButtonPressed; | ||
|
||
#endif // _SIMPLE_TOUCHSCREEN_DSO_H | ||
#endif // _SIMPLE_DSO_BLUEDISPLAY_H |
Oops, something went wrong.