move externs to .h

This commit is contained in:
jun2sak 2021-02-26 00:51:52 +09:00
parent 9328d09a7a
commit c86ca2a4ff
2 changed files with 4 additions and 4 deletions

View File

@ -55,19 +55,15 @@ mp_obj_t alarm_time_timealarm_get_wakeup_alarm(size_t n_alarms, const mp_obj_t *
return timer;
}
extern volatile int rtc_woke_up_counter;
bool alarm_time_timealarm_woke_us_up(void) {
return rtc_woke_up_counter;
}
extern void port_disable_interrupt_after_ticks_ch(uint32_t channel);
void alarm_time_timealarm_reset(void) {
port_disable_interrupt_after_ticks_ch(1);
rtc_woke_up_counter = 0;
}
extern void port_interrupt_after_ticks_ch(uint32_t channel, uint32_t ticks);//XXX in port.c
void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms) {
bool timealarm_set = false;
alarm_time_timealarm_obj_t *timealarm = MP_OBJ_NULL;

View File

@ -32,6 +32,10 @@ typedef struct {
mp_float_t monotonic_time; // values compatible with time.monotonic_time()
} alarm_time_timealarm_obj_t;
extern volatile int rtc_woke_up_counter;
extern void port_disable_interrupt_after_ticks_ch(uint32_t channel);
extern void port_interrupt_after_ticks_ch(uint32_t channel, uint32_t ticks);
// Find the alarm object that caused us to wake up or create an equivalent one.
mp_obj_t alarm_time_timealarm_get_wakeup_alarm(size_t n_alarms, const mp_obj_t *alarms);
// Check for the wake up alarm from pretend deep sleep.