Skip to content

Commit

Permalink
Merge pull request #233 from RomeroMalaquias/develop
Browse files Browse the repository at this point in the history
Avoiding conditional directives that break statements
  • Loading branch information
twatteyne committed Dec 9, 2015
2 parents 977b56c + 7d031cb commit 4183abe
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bootloader/k20/main_kinetis.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ void IRQ_ISR_PORTA(void)
#if (!(defined MCU_MK20D5)) || (!(defined _USB_BATT_CHG_APP_H_))
void IRQ_ISR_PORTC(void)
{
int test_portc = 0;
#if defined(MCU_MK20D5)
NVICICPR1 |= (uint32_t)(1 << ((42)%32));
NVICISER1 |= (uint32_t)(1 << ((42)%32));
Expand All @@ -860,10 +861,11 @@ void IRQ_ISR_PORTC(void)

DisableInterrupts;
#if(defined MCU_MK20D5) || (defined MCU_MK20D7) || (defined MCU_MK40D7)
if(PORTC_ISFR & (1<<1))
test_portc = (PORTC_ISFR & (1<<1));
#else
if(PORTC_ISFR & (1<<5))
test_portc = (PORTC_ISFR & (1<<5));
#endif
if(test_portc)
{
kbi_stat |= 0x02; /* Update the kbi state */

Expand All @@ -876,10 +878,11 @@ void IRQ_ISR_PORTC(void)
}

#if(defined MCU_MK20D5) || (defined MCU_MK20D7) || (defined MCU_MK40D7)
if(PORTC_ISFR & (1<<2))
test_portc = (PORTC_ISFR & (1<<2));
#else
if(PORTC_ISFR & (1<<13))
test_portc = (PORTC_ISFR & (1<<13));
#endif
if(test_portc)
{
kbi_stat |= 0x08; /* Update the kbi state */

Expand Down

0 comments on commit 4183abe

Please sign in to comment.