mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 23:49:00 +08:00
[test] fix test_sys_time_x
This commit is contained in:
@@ -91,12 +91,12 @@ LED_DEFINES ?= -DLED_RED=2 -DLED_GREEN=3
|
||||
test_sys_time_timer.ARCHDIR = $(ARCH)
|
||||
test_sys_time_timer.CFLAGS += $(COMMON_TEST_CFLAGS) $(LED_DEFINES)
|
||||
test_sys_time_timer.srcs += $(COMMON_TEST_SRCS)
|
||||
test_sys_time_timer.srcs += $(SRC_AIRBORNE)/test/mcu_periph/test_sys_time_timer.c
|
||||
test_sys_time_timer.srcs += test/mcu_periph/test_sys_time_timer.c
|
||||
|
||||
test_sys_time_usleep.ARCHDIR = $(ARCH)
|
||||
test_sys_time_usleep.CFLAGS += $(COMMON_TEST_CFLAGS) $(LED_DEFINES)
|
||||
test_sys_time_usleep.srcs += $(COMMON_TEST_SRCS)
|
||||
test_sys_time_usleep.srcs += $(SRC_AIRBORNE)/test/mcu_periph/test_sys_time_usleep.c
|
||||
test_sys_time_usleep.srcs += test/mcu_periph/test_sys_time_usleep.c
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "mcu.h"
|
||||
#include "led.h"
|
||||
#include "mcu_periph/sys_time.h"
|
||||
#include "interrupt_hw.h"
|
||||
|
||||
static inline void main_periodic_02( void );
|
||||
static inline void main_periodic_03( void );
|
||||
@@ -36,6 +37,8 @@ int main(void) {
|
||||
unsigned int tmr_03 = sys_time_register_timer(0.3, NULL);
|
||||
sys_time_register_timer(0.5, main_periodic_05);
|
||||
|
||||
mcu_int_enable();
|
||||
|
||||
while(1) {
|
||||
if (sys_time_check_and_ack_timer(tmr_02))
|
||||
main_periodic_02();
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "mcu.h"
|
||||
#include "led.h"
|
||||
#include "mcu_periph/sys_time.h"
|
||||
#include "interrupt_hw.h"
|
||||
|
||||
static inline void main_periodic_1(void);
|
||||
static inline void main_periodic_15(void);
|
||||
@@ -33,6 +34,8 @@ int main(void) {
|
||||
mcu_init();
|
||||
sys_time_register_timer(0.5, main_periodic_05);
|
||||
|
||||
mcu_int_enable();
|
||||
|
||||
while(1) {
|
||||
/* sleep for 1s */
|
||||
sys_time_usleep(1000000);
|
||||
|
||||
Reference in New Issue
Block a user