Starter firmware project for the Imperial College EEE SWITCH lab

Dependencies:   Adafruit_GFX mbed

Files at this revision

API Documentation at this revision

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
diff -r 5aebe57872ed -r a5b7373c4644 main.cpp
--- 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);