diff --git a/conf/Makefile.sim b/conf/Makefile.sim index 8830edd81d..34db63a13d 100644 --- a/conf/Makefile.sim +++ b/conf/Makefile.sim @@ -51,12 +51,12 @@ ifneq ($(SIM_TYPE),JSBSIM) INCLUDES += -I `ocamlc -where` endif -CFLAGS = \ - -W -Wall \ - $(INCLUDES) \ - $($(TARGET).CFLAGS) \ - $(LOCAL_CFLAGS) \ - -O2 \ +CFLAGS = -W -Wall +CFLAGS += $(INCLUDES) +CFLAGS += $($(TARGET).CFLAGS) +CFLAGS += $(LOCAL_CFLAGS) +CFLAGS += -O2 +CFLAGS += -std=gnu99 # meschach prototypes trigger numerous warnings ifneq ($(SIM_TYPE),BOOZ) @@ -66,7 +66,7 @@ endif endif -LDFLAGS = -lm \ +LDFLAGS = -lm ifeq ($(SIM_TYPE),BOOZ) LDFLAGS += $($(TARGET).LDFLAGS) diff --git a/conf/autopilot/subsystems/fixedwing/autopilot.makefile b/conf/autopilot/subsystems/fixedwing/autopilot.makefile index d63af15830..090911bbaa 100644 --- a/conf/autopilot/subsystems/fixedwing/autopilot.makefile +++ b/conf/autopilot/subsystems/fixedwing/autopilot.makefile @@ -71,7 +71,7 @@ ifndef PERIODIC_FREQUENCY PERIODIC_FREQUENCY = 60 endif $(TARGET).CFLAGS += -DPERIODIC_TASK_PERIOD='CPU_TICKS_OF_SEC((1./$(PERIODIC_FREQUENCY).))' -DPERIODIC_FREQUENCY=$(PERIODIC_FREQUENCY) -$(TARGET).srcs += mcu_periph/sys_time.c +$(TARGET).srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c # # InterMCU & Commands @@ -127,7 +127,6 @@ endif # Sys-time # ns_CFLAGS += -DUSE_SYS_TIME -DSYS_TIME_RESOLUTION='(1./300.)' -ns_srcs += $(SRC_ARCH)/mcu_periph/sys_time_arch.c # diff --git a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile index ea4bd2fae4..8e0ae66853 100644 --- a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile +++ b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile @@ -70,7 +70,7 @@ endif sim.CFLAGS += -DPERIODIC_TASK_PERIOD='CPU_TICKS_OF_SEC((1./512.))' #sim.CFLAGS += -DUSE_LED -sim.srcs += mcu_periph/sys_time.c +sim.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c sim.srcs += subsystems/settings.c sim.srcs += $(SRC_ARCH)/subsystems/settings_arch.c diff --git a/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.c b/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.c index 25c771c96b..076cd64f05 100644 --- a/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.c +++ b/sw/airborne/arch/lpc21/mcu_periph/sys_time_arch.c @@ -87,7 +87,7 @@ AMI601_IT) -void sys_time_init( void ) { +void sys_time_arch_init( void ) { /* setup Timer 0 to count forever */ /* reset & disable timer 0 */ T0TCR = TCR_RESET; @@ -113,19 +113,6 @@ void sys_time_init( void ) { /* set first sys tick interrupt */ T0MR1 = SYS_TIME_RESOLUTION_CPU_TICKS; - - sys_time.nb_sec = 0; - sys_time.nb_sec_rem = 0; - sys_time.nb_tick = 0; - - for (unsigned int i=0; i + +#define CPU_TICKS_OF_SEC(x) (x) +#define SIGNED_CPU_TICKS_OF_SEC(x) (x) + +#define SEC_OF_CPU_TICKS(st) (st) +#define MSEC_OF_CPU_TICKS(st) (st) +#define USEC_OF_CPU_TICKS(st) (st) + +#define SysTimeTimerStart(_t) { } +#define SysTimeTimer(_t) (_t) +#define SysTimeTimerStop(_t) { } + + +static inline void sys_time_usleep(uint32_t us) {} + +#endif /* SYS_TIME_ARCH_H */ diff --git a/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.c b/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.c index 5db659944e..a9582a3015 100644 --- a/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.c +++ b/sw/airborne/arch/stm32/mcu_periph/sys_time_arch.c @@ -27,7 +27,7 @@ #include "led.h" #endif -void sys_time_init( void ) { +void sys_time_arch_init( void ) { /* Generate SysTick interrupt every SYS_TIME_RESOLUTION_CPU_TICKS * The timer interrupt is activated on the transition from 1 to 0, @@ -38,19 +38,6 @@ void sys_time_init( void ) { /* Set SysTick handler priority */ NVIC_SetPriority(SysTick_IRQn, 0x0); - - sys_time.nb_sec = 0; - sys_time.nb_sec_rem = 0; - sys_time.nb_tick = 0; - - for (unsigned int i=0; i