From a54ad9edce697133a024aff096e50f7e4f389d5b Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Sun, 18 Mar 2012 12:22:02 +0100 Subject: digital/beacon: import Zigbit stack (bitcloud) & avr sources --- digital/beacon/src/sensors.c | 127 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 digital/beacon/src/sensors.c (limited to 'digital/beacon/src/sensors.c') diff --git a/digital/beacon/src/sensors.c b/digital/beacon/src/sensors.c new file mode 100644 index 00000000..150da7fa --- /dev/null +++ b/digital/beacon/src/sensors.c @@ -0,0 +1,127 @@ +#include +// #include +// #include +#include +#include "sensors.h" +// #include +// #include +// #include +// #include + +/* External variables */ +// extern APS_DataReq_t test; +// extern HAL_UsartDescriptor_t appUsartDescriptor; +// extern uint8_t usartTxBuffer[APP_USART_TX_BUFFER_SIZE]; + +// extern unsigned int top_tour; +// extern unsigned int last_tour_time; +// extern int activation_asserv; +// extern int nb_top; +// extern long last_seen_laser; + +int consigne_motor_ms = 100; +int security_ils = 1; +int old_top_tour = 0; +long angle = 0; +unsigned int status_temps_tour = 0; +unsigned int top_laser; +unsigned int counter_top_tour; + + +/********************************************************/ +void init_sensors(void) +{ +// HAL_RegisterIrq(IRQ_7,IRQ_RISING_EDGE,irq_laser); +} + +void init_ILS(void) +{ + PORTE = (1< 0xd5) + { + OCR3A = 0xd5; + } + else + { + OCR3A = correction; + } +} + +void init_ic(void) +{ + TCCR3A|=(1<