Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Adafruit_GFX mbed
Revision 2:a5b7373c4644, committed 2016-04-19
- Comitter:
- estott
- Date:
- Tue Apr 19 15:38:38 2016 +0000
- Parent:
- 1:5aebe57872ed
- Commit message:
- Rotated display; Defined switch and update variables as volatile
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Apr 08 11:35:29 2016 +0000
+++ b/main.cpp Tue Apr 19 15:38:38 2016 +0000
@@ -38,8 +38,10 @@
//Switch sampling timer
Ticker swtimer;
-//Registers for the switch counter, output register and update flag
-uint16_t scounter=0,scount=0,update=0;
+//Registers for the switch counter, switch counter latch register and update flag
+volatile uint16_t scounter=0;
+volatile uint16_t scount=0;
+volatile uint16_t update=0;
//Initialise SPI instance for communication with the display
SPIPreInit gSpi(D_MOSI_PIN,NC,D_CLK_PIN); //MOSI,MISO,CLK
@@ -49,6 +51,7 @@
int main() {
//Initialisation
+ gOled1.setRotation(2); //Set display rotation
//Attach switch oscillator counter ISR to the switch input instance for a rising edge
swin.rise(&sedge);