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.
pull/4521/head
Aksel Skauge Mellbye 2017-03-27 21:32:11 +01:00 committed by adbridge
parent 853cdc0216
commit 7550f62777
2 changed files with 6 additions and 8 deletions

View File

@ -37,9 +37,9 @@ extern "C" {
#endif #endif
typedef struct { typedef struct {
PinName pin:8; PinName pin;
PinMode mode:6; PinMode mode;
PinDirection dir:2; PinDirection dir;
} gpio_t; } gpio_t;
#if DEVICE_ANALOGIN #if DEVICE_ANALOGIN
@ -85,9 +85,9 @@ struct pwmout_s {
#if DEVICE_INTERRUPTIN #if DEVICE_INTERRUPTIN
struct gpio_irq_s { struct gpio_irq_s {
PinName pin:8; // Pin number 4 least significant bits, port number 4 most significant bits PinName pin;
uint32_t risingEdge:1; uint8_t risingEdge;
uint32_t fallingEdge:1; uint8_t fallingEdge;
}; };
#endif #endif

View File

@ -95,7 +95,6 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
inline void lp_ticker_disable_interrupt() inline void lp_ticker_disable_interrupt()
{ {
RTC_IntDisable(RTC_IF_COMP0); RTC_IntDisable(RTC_IF_COMP0);
lp_ticker_free();
} }
inline void lp_ticker_clear_interrupt() inline void lp_ticker_clear_interrupt()
@ -164,7 +163,6 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
inline void lp_ticker_disable_interrupt() inline void lp_ticker_disable_interrupt()
{ {
RTCC_IntDisable(RTCC_IF_CC0); RTCC_IntDisable(RTCC_IF_CC0);
lp_ticker_free();
} }
inline void lp_ticker_clear_interrupt() inline void lp_ticker_clear_interrupt()