* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <aversive.h>
+#include <aversive/queue.h>
+#include <aversive/pgmspace.h>
+#include <aversive/error.h>
+
+#include <uart.h>
+#include <parse.h>
+#include <rdline.h>
+#include <timer.h>
+#include <xbee.h>
+
+#include "cmdline.h"
+#include "callout.h"
+#include "rc_proto.h"
+#include "spi_servo.h"
+
#define NB_LOGS 4
/** ERROR NUMS */
#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 */
#define MAX_POWER_LEVEL 5
/* generic to all boards */
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;
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),