Swimate V2 without RTOS code

Dependencies:   Adafruit_GFX_128x64 DS3231 PinDetect SDFileSystem USBDevice mbed RealtimeMath MODSERIAL

Committer:
ellingjp
Date:
Mon Jun 09 04:55:16 2014 +0000
Revision:
24:f2503d1256ad
Parent:
23:80083138d609
Using RTC filenames

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ellingjp 21:2fa676f214fe 1 #ifndef _MAIN_H
ellingjp 21:2fa676f214fe 2 #define _MAIN_H
ellingjp 21:2fa676f214fe 3
ellingjp 8:8430a5c0914c 4 #define SYNC_HOLD_TIME_MS 1000
ellingjp 8:8430a5c0914c 5 #define DEBOUNCE_TIME_MS 200
ellingjp 0:cd1fe4f0ed39 6
ellingjp 21:2fa676f214fe 7 #include "Adafruit_SSD1306.h"
ellingjp 24:f2503d1256ad 8 #include "DS3231.h"
ellingjp 21:2fa676f214fe 9
ellingjp 23:80083138d609 10 #define USE_OLED
ellingjp 8:8430a5c0914c 11 #ifdef USE_OLED
ellingjp 21:2fa676f214fe 12
ellingjp 21:2fa676f214fe 13 extern SPI spi0; // mosi, miso, sclk
ellingjp 21:2fa676f214fe 14 extern Adafruit_SSD1306 oled; // DC, RST, CS
ellingjp 21:2fa676f214fe 15
ellingjp 0:cd1fe4f0ed39 16 #define OLED_SETCURS(xpos,ypos) oled.setCursor(xpos,ypos);
ellingjp 23:80083138d609 17 #define OLED_CLEAR() oled.clearDisplay(); oled.display();
ellingjp 0:cd1fe4f0ed39 18
ellingjp 24:f2503d1256ad 19 #define OLED_DRAWPIXEL(x,y,color) oled.drawPixel(x, y, color); oled.display();
ellingjp 20:294eaeaf2ebb 20
ellingjp 0:cd1fe4f0ed39 21 #define OLED_PRINT(x) oled.printf("%s", x); oled.display();
ellingjp 0:cd1fe4f0ed39 22 #define OLED_PRINTF(x,y) oled.printf(x, y); oled.display();
ellingjp 0:cd1fe4f0ed39 23 #define OLED_PRINTLN(x) oled.printf("%s\r\n", x); oled.display();
ellingjp 0:cd1fe4f0ed39 24 #define OLED_PRINTLNF(x,y) oled.printf(x,y); oled.printf("\r\n"); oled.display();
ellingjp 0:cd1fe4f0ed39 25 #define OLED_PRINTR(x) oled.printf("%s\r",x); oled.display();
ellingjp 0:cd1fe4f0ed39 26 #define OLED_PRINTFR(x,y) oled.printf(x,y); oled.printf("\r"); oled.display();
ellingjp 0:cd1fe4f0ed39 27
ellingjp 0:cd1fe4f0ed39 28 // Specify position
ellingjp 0:cd1fe4f0ed39 29 #define OLED_PRINTP(x,xpos,ypos) oled.setCursor(xpos,ypos); oled.printf("%s", x); oled.display();
ellingjp 0:cd1fe4f0ed39 30 #define OLED_PRINTPF(x,y,xpos,ypos) oled.setCursor(xpos,ypos); oled.printf(x, y); oled.display();
ellingjp 0:cd1fe4f0ed39 31 #define OLED_PRINTPLN(x,xpos,ypos) oled.setCursor(xpos,ypos); oled.printf("%s\r\n", x); oled.display();
ellingjp 0:cd1fe4f0ed39 32 #define OLED_PRINTPLNF(x,y,xpos,ypos) oled.setCursor(xpos,ypos); oled.printf(x,y); oled.printf("\r\n"); oled.display();
ellingjp 0:cd1fe4f0ed39 33 #define OLED_PRINTPR(x,xpos,ypos) oled.setCursor(xpos,ypos); oled.printf("%s\r",x); oled.display();
ellingjp 0:cd1fe4f0ed39 34 #define OLED_PRINTPFR(x,y,xpos,ypos) oled.setCursor(xpos,ypos); oled.printf(x,y); oled.printf("\r"); oled.display();
ellingjp 0:cd1fe4f0ed39 35 #else
ellingjp 0:cd1fe4f0ed39 36 #define OLED_SETCURS(xpos,ypos)
briggsa 18:06b718f8e6fd 37 #define OLED_CLEAR()
briggsa 18:06b718f8e6fd 38
ellingjp 20:294eaeaf2ebb 39 #define OLED_DRAWPIXEL(x, y, color)
ellingjp 20:294eaeaf2ebb 40
ellingjp 0:cd1fe4f0ed39 41 #define OLED_PRINT(x)
ellingjp 0:cd1fe4f0ed39 42 #define OLED_PRINTF(x,y)
ellingjp 0:cd1fe4f0ed39 43 #define OLED_PRINTLN(x)
ellingjp 0:cd1fe4f0ed39 44 #define OLED_PRINTLNF(x,y)
ellingjp 0:cd1fe4f0ed39 45 #define OLED_PRINTR(x)
ellingjp 0:cd1fe4f0ed39 46 #define OLED_PRINTFR(x,y)
ellingjp 0:cd1fe4f0ed39 47
ellingjp 0:cd1fe4f0ed39 48 // Specify position
ellingjp 0:cd1fe4f0ed39 49 #define OLED_PRINTP(x,xpos,ypos)
ellingjp 0:cd1fe4f0ed39 50 #define OLED_PRINTPF(x,y,xpos,ypos)
ellingjp 0:cd1fe4f0ed39 51 #define OLED_PRINTPLN(x,xpos,ypos)
ellingjp 0:cd1fe4f0ed39 52 #define OLED_PRINTPLNF(x,y,xpos,ypos)
ellingjp 0:cd1fe4f0ed39 53 #define OLED_PRINTPR(x,xpos,ypos)
ellingjp 0:cd1fe4f0ed39 54 #define OLED_PRINTPFR(x,y,xpos,ypos)
ellingjp 21:2fa676f214fe 55 #endif
ellingjp 21:2fa676f214fe 56
ellingjp 24:f2503d1256ad 57 extern DS3231 rtc;
ellingjp 24:f2503d1256ad 58
ellingjp 24:f2503d1256ad 59
ellingjp 21:2fa676f214fe 60 #endif // _MAIN_H