From 55bfff7cf6541caac172b43186cf14405185b14d Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 13 Apr 2019 12:40:52 -0400 Subject: fix curses on linux --- .../CEdev/examples/real_time_clock/makefile | 30 ++++----- .../CEdev/examples/real_time_clock/readme.md | 20 +++--- .../CEdev/examples/real_time_clock/src/main.c | 78 +++++++++++----------- 3 files changed, 64 insertions(+), 64 deletions(-) (limited to 'frontends/calculator/CEdev/examples/real_time_clock') diff --git a/frontends/calculator/CEdev/examples/real_time_clock/makefile b/frontends/calculator/CEdev/examples/real_time_clock/makefile index 1f1b36b..d3deba8 100644 --- a/frontends/calculator/CEdev/examples/real_time_clock/makefile +++ b/frontends/calculator/CEdev/examples/real_time_clock/makefile @@ -1,15 +1,15 @@ -# ---------------------------- -# Set NAME to the program name -# Set ICON to the png icon file name -# Set DESCRIPTION to display within a compatible shell -# Set COMPRESSED to "YES" to create a compressed program -# ---------------------------- - -NAME ?= DEMO -COMPRESSED ?= NO -ICON ?= iconc.png -DESCRIPTION ?= "C SDK Demo" - -# ---------------------------- - -include $(CEDEV)/include/.makefile +# ---------------------------- +# Set NAME to the program name +# Set ICON to the png icon file name +# Set DESCRIPTION to display within a compatible shell +# Set COMPRESSED to "YES" to create a compressed program +# ---------------------------- + +NAME ?= DEMO +COMPRESSED ?= NO +ICON ?= iconc.png +DESCRIPTION ?= "C SDK Demo" + +# ---------------------------- + +include $(CEDEV)/include/.makefile diff --git a/frontends/calculator/CEdev/examples/real_time_clock/readme.md b/frontends/calculator/CEdev/examples/real_time_clock/readme.md index 08554eb..548e5b5 100644 --- a/frontends/calculator/CEdev/examples/real_time_clock/readme.md +++ b/frontends/calculator/CEdev/examples/real_time_clock/readme.md @@ -1,10 +1,10 @@ -### Real Time Clock Demo - -This demo demonstrates how to use the basics of the real time clock (RTC) - -![Screenshot](screenshot.gif) - ---- - -This demo is a part of the C SDK Toolchain for use on the CE. - +### Real Time Clock Demo + +This demo demonstrates how to use the basics of the real time clock (RTC) + +![Screenshot](screenshot.gif) + +--- + +This demo is a part of the C SDK Toolchain for use on the CE. + diff --git a/frontends/calculator/CEdev/examples/real_time_clock/src/main.c b/frontends/calculator/CEdev/examples/real_time_clock/src/main.c index 1aa24cb..fa9b881 100644 --- a/frontends/calculator/CEdev/examples/real_time_clock/src/main.c +++ b/frontends/calculator/CEdev/examples/real_time_clock/src/main.c @@ -1,39 +1,39 @@ -#include -#include -#include -#include - -#include -#include -#include - -unsigned int seconds = 0; - -void main(void) { - - /* Clear the homescreen */ - os_ClrHome(); - - /* Randomize things */ - srand(rtc_Time()); - - /* Configure the RTC */ - rtc_LoadSeconds = rtc_LoadMinutes = rtc_LoadHours = rtc_LoadDays = 0; - rtc_Control = RTC_ENABLE | RTC_LOAD | RTC_SEC_INT_SOURCE; - - /* Wait for the RTC to load in the new values and then acknowledge all the interrupts */ - while (rtc_IsBusy()); - rtc_IntAcknowledge = RTC_INT_MASK; - - /* Wait until 5 seconds have passed */ - while (seconds < 5) { - - /* If a second passed, increment the second counter */ - if (rtc_IntStatus & RTC_SEC_INT) { - memset(lcd_Ram, randInt(0,255), LCD_SIZE); - seconds++; - - rtc_IntAcknowledge = rtc_IntStatus; - } - } -} +#include +#include +#include +#include + +#include +#include +#include + +unsigned int seconds = 0; + +void main(void) { + + /* Clear the homescreen */ + os_ClrHome(); + + /* Randomize things */ + srand(rtc_Time()); + + /* Configure the RTC */ + rtc_LoadSeconds = rtc_LoadMinutes = rtc_LoadHours = rtc_LoadDays = 0; + rtc_Control = RTC_ENABLE | RTC_LOAD | RTC_SEC_INT_SOURCE; + + /* Wait for the RTC to load in the new values and then acknowledge all the interrupts */ + while (rtc_IsBusy()); + rtc_IntAcknowledge = RTC_INT_MASK; + + /* Wait until 5 seconds have passed */ + while (seconds < 5) { + + /* If a second passed, increment the second counter */ + if (rtc_IntStatus & RTC_SEC_INT) { + memset(lcd_Ram, randInt(0,255), LCD_SIZE); + seconds++; + + rtc_IntAcknowledge = rtc_IntStatus; + } + } +} -- cgit v1.2.3-101-g0448