From e062d102509b81aed745ca0367fa0053495b8761 Mon Sep 17 00:00:00 2001 From: barthess Date: Sat, 17 Dec 2011 19:08:16 +0000 Subject: Cleaned "//" comments. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3628 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32F1xx/I2C/Makefile | 2 +- testhal/STM32F1xx/RTC/main.c | 2 +- testhal/STM32F4xx/RTC/main.c | 34 ++++++++++++++++++++++++++-------- 3 files changed, 28 insertions(+), 10 deletions(-) (limited to 'testhal') diff --git a/testhal/STM32F1xx/I2C/Makefile b/testhal/STM32F1xx/I2C/Makefile index 829c472df..08494928a 100644 --- a/testhal/STM32F1xx/I2C/Makefile +++ b/testhal/STM32F1xx/I2C/Makefile @@ -31,7 +31,7 @@ endif # Enable this if you want to see the full log while compiling. ifeq ($(USE_VERBOSE_COMPILE),) - USE_VERBOSE_COMPILE = no + USE_VERBOSE_COMPILE = yes endif # diff --git a/testhal/STM32F1xx/RTC/main.c b/testhal/STM32F1xx/RTC/main.c index ea7155f47..84df3c109 100644 --- a/testhal/STM32F1xx/RTC/main.c +++ b/testhal/STM32F1xx/RTC/main.c @@ -72,7 +72,7 @@ static void my_cb(RTCDriver *rtcp, rtcevent_t event) { palTogglePad(GPIOC, GPIOC_LED); break; case RTC_EVENT_SECOND: - //palTogglePad(GPIOC, GPIOC_LED); + /* palTogglePad(GPIOC, GPIOC_LED); */ break; case RTC_EVENT_ALARM: palTogglePad(GPIOC, GPIOC_LED); diff --git a/testhal/STM32F4xx/RTC/main.c b/testhal/STM32F4xx/RTC/main.c index f8bd9fa85..675e42b20 100644 --- a/testhal/STM32F4xx/RTC/main.c +++ b/testhal/STM32F4xx/RTC/main.c @@ -23,6 +23,24 @@ #include "ch.h" #include "hal.h" +/*===========================================================================*/ +/* Notes. */ +/*===========================================================================*/ +/* +This structure is used to hold the values representing a calendar time. +It contains the following members, with the meanings as shown. + +int tm_sec seconds after minute [0-61] (61 allows for 2 leap-seconds) +int tm_min minutes after hour [0-59] +int tm_hour hours after midnight [0-23] +int tm_mday day of the month [1-31] +int tm_mon month of year [0-11] +int tm_year current year-1900 +int tm_wday days since Sunday [0-6] +int tm_yday days since January 1st [0-365] +int tm_isdst daylight savings indicator (1 = yes, 0 = no, -1 = unknown) +*/ + RTCTime timespec; RTCAlarm alarmspec; RTCWakeup wakeupspec; @@ -78,12 +96,12 @@ static const EXTConfig extcfg = { {EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL}, - {EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART, exti_rtcalarm_cb},// RTC alarms + {EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART, exti_rtcalarm_cb},/* RTC alarms */ {EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL}, {EXT_CH_MODE_DISABLED, NULL}, - {EXT_CH_MODE_DISABLED, NULL},// timestamp - {EXT_CH_MODE_RISING_EDGE| EXT_CH_MODE_AUTOSTART, exti_rtcwakeup_cb},// wakeup + {EXT_CH_MODE_DISABLED, NULL},/* timestamp */ + {EXT_CH_MODE_RISING_EDGE| EXT_CH_MODE_AUTOSTART, exti_rtcwakeup_cb},/* wakeup */ }, EXT_MODE_EXTI( 0, @@ -101,7 +119,7 @@ static const EXTConfig extcfg = { 0, 0, 0, - 0)//15 + 0)/* 15 */ }; /** @@ -126,7 +144,7 @@ void bcd2tm(struct tm *timp, uint32_t tv_time, uint32_t tv_date){ * Convert from classical format to STM32 BCD */ void tm2bcd(struct tm *timp, RTCTime *timespec){ - uint32_t v = 0; // temporal variable + uint32_t v = 0; timespec->tv_date = 0; timespec->tv_time = 0; @@ -164,8 +182,8 @@ int main(void){ extStart(&EXTD1, &extcfg); /* tune wakeup callback */ - wakeupspec.wakeup = ((uint32_t)4) << 16; // select 1 Hz clock source - wakeupspec.wakeup |= 3; // set counter value to 3. Period will be 3+1 seconds. + wakeupspec.wakeup = ((uint32_t)4) << 16; /* select 1 Hz clock source */ + wakeupspec.wakeup |= 3; /* set counter value to 3. Period will be 3+1 seconds. */ rtcSetWakeup(&RTCD1, &wakeupspec); /* enable wakeup callback */ @@ -177,7 +195,7 @@ int main(void){ bcd2tm(&timp, timespec.tv_time, timespec.tv_date); unix_time = mktime(&timp); - if (unix_time == -1){// incorrect time in RTC cell + if (unix_time == -1){/* incorrect time in RTC cell */ unix_time = 1000000000; } /* set correct time */ -- cgit v1.2.3