First coarse run to fix coding style in locm3.

Added --terse and --mailback options to the make stylecheck target. It
also does continue even if it enounters a possible error.

We decided on two exceptions from the linux kernel coding standard:
- Empty wait while loops may end with ; on the same line.
- All blocks after while, if, for have to be in brackets even if they
  only contain one statement. Otherwise it is easy to introduce an
  error.

Checkpatch needs to be adapted to reflect those changes.
This commit is contained in:
Piotr Esden-Tempski
2013-06-12 17:44:07 -07:00
parent 48e0f3326b
commit 7df63fcae0
147 changed files with 3323 additions and 2565 deletions

View File

@@ -39,9 +39,10 @@ LGPL License Terms @ref lgpl_license
@warning You must unlock the registers before using this function
*/
void rtc_enable_wakeup_timer(void) {
RTC_CR |= RTC_CR_WUTE | (RTC_CR_OSEL_WAKEUP << RTC_CR_OSEL_SHIFT);
rtc_enable_wakeup_timer_interrupt();
void rtc_enable_wakeup_timer(void)
{
RTC_CR |= RTC_CR_WUTE | (RTC_CR_OSEL_WAKEUP << RTC_CR_OSEL_SHIFT);
rtc_enable_wakeup_timer_interrupt();
}
/*---------------------------------------------------------------------------*/
@@ -49,9 +50,10 @@ void rtc_enable_wakeup_timer(void) {
@warning You must unlock the registers before using this function
*/
void rtc_disable_wakeup_timer(void) {
RTC_CR &= ~RTC_CR_WUTE;
rtc_disable_wakeup_timer_interrupt();
void rtc_disable_wakeup_timer(void)
{
RTC_CR &= ~RTC_CR_WUTE;
rtc_disable_wakeup_timer_interrupt();
}
/*---------------------------------------------------------------------------*/
@@ -59,20 +61,23 @@ void rtc_disable_wakeup_timer(void) {
@warning You must unlock the registers before using this function
*/
void rtc_enable_wakeup_timer_interrupt(void) {
// FTFM:
// To enable the RTC Wakeup interrupt, the following sequence is required:
// 1. Configure and enable the EXTI Line 22 in interrupt mode and select the
// rising edge sensitivity.
exti_enable_request(EXTI22);
exti_set_trigger(EXTI22, EXTI_TRIGGER_RISING);
void rtc_enable_wakeup_timer_interrupt(void)
{
/* FTFM:
* To enable the RTC Wakeup interrupt, the following sequence is
* required:
* 1. Configure and enable the EXTI Line 22 in interrupt mode and
* select the rising edge sensitivity.
*/
exti_enable_request(EXTI22);
exti_set_trigger(EXTI22, EXTI_TRIGGER_RISING);
// 2. Configure and enable the RTC_WKUP IRQ channel in the NVIC.
nvic_enable_irq(NVIC_RTC_WKUP_IRQ);
nvic_set_priority(NVIC_RTC_WKUP_IRQ, 1);
/* 2. Configure and enable the RTC_WKUP IRQ channel in the NVIC. */
nvic_enable_irq(NVIC_RTC_WKUP_IRQ);
nvic_set_priority(NVIC_RTC_WKUP_IRQ, 1);
// 3. Configure the RTC to generate the RTC wakeup timer event.
RTC_CR |= RTC_CR_WUTIE; // Enable the interrupt
/* 3. Configure the RTC to generate the RTC wakeup timer event. */
RTC_CR |= RTC_CR_WUTIE; /* Enable the interrupt */
}
/*---------------------------------------------------------------------------*/
@@ -80,13 +85,14 @@ void rtc_enable_wakeup_timer_interrupt(void) {
@warning You must unlock the registers before using this function
*/
void rtc_disable_wakeup_timer_interrupt(void) {
// 1. Disable EXTI Line 22
exti_disable_request(EXTI22);
void rtc_disable_wakeup_timer_interrupt(void)
{
/* 1. Disable EXTI Line 22 */
exti_disable_request(EXTI22);
// 2. Disable RTC_WKUP IRQ channel in the NVIC.
nvic_disable_irq(NVIC_RTC_WKUP_IRQ);
/* 2. Disable RTC_WKUP IRQ channel in the NVIC. */
nvic_disable_irq(NVIC_RTC_WKUP_IRQ);
// 3. Disable RTC wakeup timer event.
RTC_CR &= ~RTC_CR_WUTIE;
/* 3. Disable RTC wakeup timer event. */
RTC_CR &= ~RTC_CR_WUTIE;
}