19
19
* GNU General Public License for more details.
20
20
*
21
21
* You should have received a copy of the GNU General Public License
22
- * along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
23
23
*
24
24
*/
25
25
26
+ #define SUPPRESS_HPP_WARNING
27
+
26
28
#if defined(AVR)
27
29
#include < Arduino.h>
30
+
28
31
#include " SimpleTouchScreenDSO.h"
29
32
#include " digitalWriteFast.h"
30
33
#else
31
34
#include " Pages.h"
32
35
#include " TouchDSO.h"
33
36
34
37
#include " Chart.h" // for adjustIntWithScaleFactor()
35
- #endif
36
-
37
38
#include " BlueDisplay.h"
39
+ #endif // defined(AVR)
38
40
39
41
uint8_t sLastPickerValue ;
40
42
@@ -502,7 +504,7 @@ const char sTriggerModeButtonStringManualTimeout[] PROGMEM = "Trigger\nman timeo
502
504
const char sTriggerModeButtonStringManual [] PROGMEM = " Trigger\n man" ;
503
505
const char sTriggerModeButtonStringFreeRunning [] PROGMEM = " Trigger\n free" ;
504
506
const char sTriggerModeButtonStringExternal [] PROGMEM = " Trigger\n ext" ;
505
- const char * const sTriggerModeButtonCaptionStringArray [] PROGMEM = { sTriggerModeButtonStringAuto ,
507
+ const char *const sTriggerModeButtonCaptionStringArray [] PROGMEM = { sTriggerModeButtonStringAuto ,
506
508
sTriggerModeButtonStringManualTimeout , sTriggerModeButtonStringManual , sTriggerModeButtonStringFreeRunning ,
507
509
sTriggerModeButtonStringExternal };
508
510
@@ -522,7 +524,7 @@ const char StringTemperature[] PROGMEM = "Temp";
522
524
const char StringVRefint[] PROGMEM = " VRef" ;
523
525
const char StringVBattDiv2[] PROGMEM = " \xBD " " VBatt" ;
524
526
#if defined(AVR)
525
- const char * const ADCInputMUXChannelStrings[] = { StringChannel0, StringChannel1, StringChannel2, StringChannel3, StringChannel4,
527
+ const char *const ADCInputMUXChannelStrings[] = { StringChannel0, StringChannel1, StringChannel2, StringChannel3, StringChannel4,
526
528
StringTemperature, StringVRefint };
527
529
#else
528
530
#if defined(STM)32F30X
@@ -540,15 +542,15 @@ const uint8_t ADCInputMUXChannels[] = {ADC_CHANNEL_0, ADC_CHANNEL_1, ADC_CHANNEL
540
542
const char ChannelDivBy1ButtonString[] PROGMEM = " \xF7 " " 1" ;
541
543
const char ChannelDivBy10ButtonString[] PROGMEM = " \xF7 " " 10" ;
542
544
const char ChannelDivBy100ButtonString[] PROGMEM = " \xF7 " " 100" ;
543
- const char * const ChannelDivByButtonStrings[] = { ChannelDivBy1ButtonString,
544
- ChannelDivBy10ButtonString, ChannelDivBy100ButtonString };
545
+ const char *const ChannelDivByButtonStrings[] =
546
+ { ChannelDivBy1ButtonString, ChannelDivBy10ButtonString, ChannelDivBy100ButtonString };
545
547
BDButton TouchButtonChannelMode;
546
548
547
549
BDButton TouchButtonAutoOffsetMode;
548
550
const char AutoOffsetButtonString0[] PROGMEM = " Offset\n 0V" ;
549
551
const char AutoOffsetButtonStringAuto[] PROGMEM = " Offset\n auto" ;
550
552
const char AutoOffsetButtonStringMan[] PROGMEM = " Offset\n man" ;
551
- const char * const sAutoOffsetButtonCaptionStringArray [] PROGMEM = { AutoOffsetButtonString0, AutoOffsetButtonStringAuto,
553
+ const char *const sAutoOffsetButtonCaptionStringArray [] PROGMEM = { AutoOffsetButtonString0, AutoOffsetButtonStringAuto,
552
554
AutoOffsetButtonStringMan };
553
555
554
556
BDButton TouchButtonAutoRangeOnOff;
@@ -685,7 +687,7 @@ void initDSOGUI(void) {
685
687
686
688
// Button for channel select
687
689
TouchButtonChannelSelect.init (REMOTE_DISPLAY_WIDTH - BUTTON_WIDTH_6, tPosY, BUTTON_WIDTH_6, SETTINGS_PAGE_BUTTON_HEIGHT,
688
- BUTTON_AUTO_RED_GREEN_FALSE_COLOR, reinterpret_cast <const __FlashStringHelper *>(StringChannel3), TEXT_SIZE_11,
690
+ BUTTON_AUTO_RED_GREEN_FALSE_COLOR, reinterpret_cast <const __FlashStringHelper*>(StringChannel3), TEXT_SIZE_11,
689
691
FLAG_BUTTON_DO_BEEP_ON_TOUCH, 42 , &doChannelSelect);
690
692
691
693
// 4. row
@@ -1257,7 +1259,8 @@ void setAutoRangeModeAndButtonCaption(bool aNewAutoRangeMode) {
1257
1259
}
1258
1260
1259
1261
void setAutoOffsetButtonCaption (void ) {
1260
- TouchButtonAutoOffsetMode.setCaptionFromStringArrayPGM (sAutoOffsetButtonCaptionStringArray , MeasurementControl.OffsetMode , (DisplayControl.DisplayPage == DISPLAY_PAGE_SETTINGS));
1262
+ TouchButtonAutoOffsetMode.setCaptionFromStringArrayPGM (sAutoOffsetButtonCaptionStringArray , MeasurementControl.OffsetMode ,
1263
+ (DisplayControl.DisplayPage == DISPLAY_PAGE_SETTINGS));
1261
1264
}
1262
1265
1263
1266
void setACModeButtonCaption (void ) {
@@ -1314,7 +1317,7 @@ void startDSOSettingsPage(void) {
1314
1317
* Use touch up in order not to interfere with long touch
1315
1318
* Switch between upper info line short/long/off
1316
1319
*/
1317
- void doSwitchInfoModeOnTouchUp (struct TouchEvent * const aTouchPosition) {
1320
+ void doSwitchInfoModeOnTouchUp (struct TouchEvent *const aTouchPosition) {
1318
1321
#if defined(LOCAL_DISPLAY_EXISTS)
1319
1322
// first check for buttons
1320
1323
if (!TouchButton::checkAllButtons (aTouchPosition->TouchPosition .PosX , aTouchPosition->TouchPosition .PosY )) {
@@ -1351,7 +1354,7 @@ void doSwitchInfoModeOnTouchUp(struct TouchEvent * const aTouchPosition) {
1351
1354
* If stopped toggle between Start and Chart page
1352
1355
* If running toggle between gui display and chart only
1353
1356
*/
1354
- void doLongTouchDownDSO (struct TouchEvent * const aTochPosition) {
1357
+ void doLongTouchDownDSO (struct TouchEvent *const aTochPosition) {
1355
1358
static bool sIsGUIVisible = false ;
1356
1359
if (DisplayControl.DisplayPage == DISPLAY_PAGE_CHART) {
1357
1360
if (MeasurementControl.isRunning ) {
@@ -1378,7 +1381,7 @@ void doLongTouchDownDSO(struct TouchEvent * const aTochPosition) {
1378
1381
/* *
1379
1382
* responsible for swipe detection and dispatching
1380
1383
*/
1381
- void doSwipeEndDSO (struct Swipe * const aSwipeInfo) {
1384
+ void doSwipeEndDSO (struct Swipe *const aSwipeInfo) {
1382
1385
#if defined(AVR)
1383
1386
uint8_t tFeedbackType = FEEDBACK_TONE_ERROR;
1384
1387
#else
@@ -1458,27 +1461,27 @@ void doSwipeEndDSO(struct Swipe * const aSwipeInfo) {
1458
1461
/*
1459
1462
* default handler for back button
1460
1463
*/
1461
- void doDefaultBackButton (BDButton * aTheTouchedButton, int16_t aValue) {
1464
+ void doDefaultBackButton (BDButton *aTheTouchedButton, int16_t aValue) {
1462
1465
sBackButtonPressed = true ;
1463
1466
}
1464
1467
1465
1468
/*
1466
1469
* show gui of settings screen
1467
1470
*/
1468
- void doShowSettingsPage (BDButton * aTheTouchedButton, int16_t aValue) {
1471
+ void doShowSettingsPage (BDButton *aTheTouchedButton, int16_t aValue) {
1469
1472
DisplayControl.DisplayPage = DISPLAY_PAGE_SETTINGS;
1470
1473
redrawDisplay ();
1471
1474
}
1472
1475
1473
- void doShowFrequencyPage (BDButton * aTheTouchedButton, int16_t aValue) {
1476
+ void doShowFrequencyPage (BDButton *aTheTouchedButton, int16_t aValue) {
1474
1477
DisplayControl.DisplayPage = DISPLAY_PAGE_FREQUENCY;
1475
1478
startFrequencyGeneratorPage ();
1476
1479
}
1477
1480
1478
1481
/*
1479
1482
* toggle between ascending and descending trigger slope
1480
1483
*/
1481
- void doTriggerSlope (BDButton * aTheTouchedButton, int16_t aValue) {
1484
+ void doTriggerSlope (BDButton *aTheTouchedButton, int16_t aValue) {
1482
1485
MeasurementControl.TriggerSlopeRising = (!MeasurementControl.TriggerSlopeRising );
1483
1486
setTriggerLevelAndHysteresis (MeasurementControl.RawTriggerLevel , MeasurementControl.RawHysteresis );
1484
1487
setSlopeButtonCaption ();
@@ -1487,7 +1490,7 @@ void doTriggerSlope(BDButton * aTheTouchedButton, int16_t aValue) {
1487
1490
/*
1488
1491
* switch between automatic, manual, free and external trigger mode
1489
1492
*/
1490
- void doTriggerMode (BDButton * aTheTouchedButton, int16_t aValue) {
1493
+ void doTriggerMode (BDButton *aTheTouchedButton, int16_t aValue) {
1491
1494
uint8_t tNewMode = MeasurementControl.TriggerMode + 1 ;
1492
1495
if (tNewMode > TRIGGER_MODE_EXTERN) {
1493
1496
tNewMode = TRIGGER_MODE_AUTOMATIC;
@@ -1505,15 +1508,15 @@ void doTriggerMode(BDButton * aTheTouchedButton, int16_t aValue) {
1505
1508
setTriggerModeButtonCaption ();
1506
1509
}
1507
1510
1508
- void doRangeMode (BDButton * aTheTouchedButton, int16_t aValue) {
1511
+ void doRangeMode (BDButton *aTheTouchedButton, int16_t aValue) {
1509
1512
setAutoRangeModeAndButtonCaption (!MeasurementControl.RangeAutomatic );
1510
1513
}
1511
1514
1512
1515
/*
1513
1516
* step from 0 volt to auto to manual offset
1514
1517
* No auto offset in AC Mode for AVR
1515
1518
*/
1516
- void doOffsetMode (BDButton * aTheTouchedButton, int16_t aValue) {
1519
+ void doOffsetMode (BDButton *aTheTouchedButton, int16_t aValue) {
1517
1520
MeasurementControl.OffsetMode ++;
1518
1521
if (MeasurementControl.OffsetMode > OFFSET_MODE_MANUAL) {
1519
1522
// switch back from Mode Manual to mode 0 volt and set range mode to automatic
@@ -1537,7 +1540,7 @@ void doOffsetMode(BDButton * aTheTouchedButton, int16_t aValue) {
1537
1540
/*
1538
1541
* Cycle through all external and internal adc channels if button value is > 20
1539
1542
*/
1540
- void doChannelSelect (BDButton * aTheTouchedButton, int16_t aValue) {
1543
+ void doChannelSelect (BDButton *aTheTouchedButton, int16_t aValue) {
1541
1544
#if defined(LOCAL_DISPLAY_EXISTS)
1542
1545
if (MeasurementControl.ADS7846ChannelsAsDatasource ) {
1543
1546
// ADS7846 channels
@@ -1591,7 +1594,7 @@ void doChannelSelect(BDButton * aTheTouchedButton, int16_t aValue) {
1591
1594
/*
1592
1595
* Toggle history mode
1593
1596
*/
1594
- void doChartHistory (BDButton * aTheTouchedButton, int16_t aValue) {
1597
+ void doChartHistory (BDButton *aTheTouchedButton, int16_t aValue) {
1595
1598
DisplayControl.showHistory = aValue;
1596
1599
if (DisplayControl.DisplayPage == DISPLAY_PAGE_SETTINGS) {
1597
1600
aTheTouchedButton->drawButton ();
@@ -1611,7 +1614,7 @@ void doChartHistory(BDButton * aTheTouchedButton, int16_t aValue) {
1611
1614
/*
1612
1615
* set to singleshot mode and draw an indicating "S" for AVR
1613
1616
*/
1614
- void doStartSingleshot (BDButton * aTheTouchedButton, int16_t aValue) {
1617
+ void doStartSingleshot (BDButton *aTheTouchedButton, int16_t aValue) {
1615
1618
aTheTouchedButton->deactivate ();
1616
1619
MeasurementControl.isSingleShotMode = true ;
1617
1620
@@ -1720,7 +1723,7 @@ void doVoltagePicker(BDSlider *aTheTouchedSlider, uint16_t aValue) {
1720
1723
/*
1721
1724
* Request delay value as number
1722
1725
*/
1723
- void doPromptForTriggerDelay (BDButton * aTheTouchedButton, int16_t aValue) {
1726
+ void doPromptForTriggerDelay (BDButton *aTheTouchedButton, int16_t aValue) {
1724
1727
BlueDisplay1.getNumberWithShortPrompt (&doSetTriggerDelay, F (" Trigger delay [\xB5 s]" ));
1725
1728
}
1726
1729
0 commit comments