X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=main.h;h=30a92625037217d99d831535318d612279a1e196;hp=87070a30029364180e19018399f4bdda50718971;hb=a53014b7f52462e163a7d7ac64866aa75977422f;hpb=2710a676cfb8d84c4e4de9d4e0ba2e8f3b553120 diff --git a/main.h b/main.h index 87070a3..30a9262 100644 --- a/main.h +++ b/main.h @@ -31,25 +31,16 @@ #include #include -#include -#include #include #include #include +#include -#include "xbee_neighbor.h" -#include "xbee_atcmd.h" -#include "xbee_stats.h" -#include "xbee_buf.h" -#include "xbee_proto.h" -#include "xbee.h" #include "cmdline.h" #include "callout.h" #include "rc_proto.h" #include "spi_servo.h" -extern volatile uint16_t global_ms; - #define NB_LOGS 4 /** ERROR NUMS */ @@ -64,9 +55,13 @@ extern volatile uint16_t global_ms; #define LED3_ON() sbi(PORTA, 0) #define LED3_OFF() cbi(PORTA, 0) +#define BUZZER_ON() sbi(PORTA, 4) +#define BUZZER_OFF() cbi(PORTA, 4) + /* highest priority */ #define LED_PRIO 170 #define TIME_PRIO 160 +#define BEEP_PRIO 130 #define SPI_PRIO 100 /* users of spi_servo must have lower prio */ /* lowest priority */ @@ -77,6 +72,11 @@ struct xbeeboard { struct rdline rdl; char prompt[RDLINE_PROMPT_SIZE]; + struct callout_mgr mainloop_cm; + struct callout_mgr intr_cm; + struct callout spi_timer; + struct callout beep_timer; + /* log */ uint8_t logs[NB_LOGS+1]; uint8_t log_level; @@ -100,14 +100,12 @@ extern struct xbee_dev *xbee_dev; extern int xbee_raw; extern int xbee_hexdump; extern int xbee_debug; - -extern struct callout_manager cm; - +extern volatile uint32_t global_ms; void bootloader(void); -void xbee_rx(struct xbee_dev *dev, int channel, int type, - void *frame, unsigned len, void *opaque); +int8_t xbeeapp_rx(struct xbee_dev *dev, int channel, int type, + void *frame, unsigned len, void *opaque); int xbeeapp_send_atcmd(const char *atcmd_str, void *param, unsigned param_len, int foreground, int (*func)(void *frame, unsigned len, void *arg),