From 09777b916c927812147f512dd5d20d30a590f6a4 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Fri, 31 May 2013 16:43:40 -0400 Subject: [PATCH] Fiddle around to get tests suite passing...going a little crazy. --- Makefile | 2 +- arduino/baudsetter.ino | 2 ++ atcommander/atcommander.c | 4 ++-- atcommander/atcommander.h | 2 +- tests/tests.c | 3 +++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ab860c7..9e07e69 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CC = gcc +CC = g++ INCLUDES = -I. -Iatcommander CFLAGS = $(INCLUDES) -c -w -Wall -Werror -g -ggdb LDFLAGS = diff --git a/arduino/baudsetter.ino b/arduino/baudsetter.ino index 102a19d..c286cda 100644 --- a/arduino/baudsetter.ino +++ b/arduino/baudsetter.ino @@ -3,6 +3,8 @@ #include "WProgram.h" #include +extern const AtCommanderPlatform AT_PLATFORM_RN42; + bool configured = false; AtCommanderConfig config; diff --git a/atcommander/atcommander.c b/atcommander/atcommander.c index c4455cf..3978008 100644 --- a/atcommander/atcommander.c +++ b/atcommander/atcommander.c @@ -14,7 +14,7 @@ config->log_function("\r\n"); \ } -const AtCommanderPlatform AT_PLATFORM_RN42 = { +AtCommanderPlatform AT_PLATFORM_RN42 = { DEFAULT_RESPONSE_DELAY_MS, rn42_baud_rate_mapper, { "$$$", "CMD\r\n" }, @@ -24,7 +24,7 @@ const AtCommanderPlatform AT_PLATFORM_RN42 = { { "R,1\r", NULL }, }; -const AtCommanderPlatform AT_PLATFORM_XBEE = { +AtCommanderPlatform AT_PLATFORM_XBEE = { 3000, xbee_baud_rate_mapper, { "+++", "OK" }, diff --git a/atcommander/atcommander.h b/atcommander/atcommander.h index 4de1c54..6c29c79 100644 --- a/atcommander/atcommander.h +++ b/atcommander/atcommander.h @@ -21,7 +21,7 @@ typedef struct { } AtCommand; typedef struct { - const int response_delay_ms; + int response_delay_ms; int (*baud_rate_mapper)(int baud); AtCommand enter_command_mode_command; AtCommand exit_command_mode_command; diff --git a/tests/tests.c b/tests/tests.c index 5d4b7f2..17fc7e6 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -5,6 +5,9 @@ #include #include +extern const AtCommanderPlatform AT_PLATFORM_RN42; +extern const AtCommanderPlatform AT_PLATFORM_XBEE; + AtCommanderConfig config; void debug(const char* format, ...) {