Skip to content

Commit 567dbf7

Browse files
asmellby0xc0170
authored andcommitted
[Silicon Labs] Fix compile warnings and ticker test failure
* Using PinName as bitfield doesn't work without warnings, since NC needs all 32 bits to be represented. * lp_ticker should not be freed when interrupt is disabled, since this will kill the timebase.
1 parent 19bbf26 commit 567dbf7

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/common/objects.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ extern "C" {
3737
#endif
3838

3939
typedef struct {
40-
PinName pin:8;
41-
PinMode mode:6;
42-
PinDirection dir:2;
40+
PinName pin;
41+
PinMode mode;
42+
PinDirection dir;
4343
} gpio_t;
4444

4545
#if DEVICE_ANALOGIN
@@ -84,9 +84,9 @@ struct pwmout_s {
8484

8585
#if DEVICE_INTERRUPTIN
8686
struct gpio_irq_s {
87-
PinName pin:8; // Pin number 4 least significant bits, port number 4 most significant bits
88-
uint32_t risingEdge:1;
89-
uint32_t fallingEdge:1;
87+
PinName pin;
88+
uint8_t risingEdge;
89+
uint8_t fallingEdge;
9090
};
9191
#endif
9292

targets/TARGET_Silicon_Labs/TARGET_EFM32/lp_ticker.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
9595
inline void lp_ticker_disable_interrupt()
9696
{
9797
RTC_IntDisable(RTC_IF_COMP0);
98-
lp_ticker_free();
9998
}
10099

101100
inline void lp_ticker_clear_interrupt()
@@ -164,7 +163,6 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
164163
inline void lp_ticker_disable_interrupt()
165164
{
166165
RTCC_IntDisable(RTCC_IF_CC0);
167-
lp_ticker_free();
168166
}
169167

170168
inline void lp_ticker_clear_interrupt()

0 commit comments

Comments
 (0)