mirror of https://github.com/rusefi/ChibiOS.git
Cleaned "//" comments.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3628 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
843b44675b
commit
e062d10250
|
@ -31,24 +31,6 @@
|
|||
|
||||
#if HAL_USE_RTC || defined(__DOXYGEN__)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* 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)
|
||||
*/
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver exported variables. */
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -508,7 +508,7 @@ void i2c_lld_master_receive(I2CDriver *i2cp, uint8_t slave_addr,
|
|||
i2cp->errors = 0;
|
||||
|
||||
mode = STM32_DMA_CR_DIR_P2M;
|
||||
// TODO: DMA error handling
|
||||
/* TODO: DMA error handling */
|
||||
dmaStreamSetMemory0(i2cp->dmarx, rxbuf);
|
||||
dmaStreamSetTransactionSize(i2cp->dmarx, rxbytes);
|
||||
dmaStreamSetMode(i2cp->dmarx, ((i2cp->dmamode) | mode));
|
||||
|
@ -553,7 +553,7 @@ void i2c_lld_master_transmit(I2CDriver *i2cp, uint8_t slave_addr,
|
|||
i2cp->errors = 0;
|
||||
|
||||
mode = STM32_DMA_CR_DIR_M2P;
|
||||
// TODO: DMA error handling
|
||||
/* TODO: DMA error handling */
|
||||
dmaStreamSetMemory0(i2cp->dmatx, txbuf);
|
||||
dmaStreamSetTransactionSize(i2cp->dmatx, txbytes);
|
||||
dmaStreamSetMode(i2cp->dmatx, ((i2cp->dmamode) | mode));
|
||||
|
|
|
@ -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
|
||||
|
||||
#
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue