diff --git a/src/libs/STBTLE b/src/libs/STBTLE index 0a3504cf2..da9c23ee4 160000 --- a/src/libs/STBTLE +++ b/src/libs/STBTLE @@ -1 +1 @@ -Subproject commit 0a3504cf213c9b913658636fe781eaba3c866422 +Subproject commit da9c23ee4d92c60087487879c31708be5d74f7dd diff --git a/src/libs/cJSON b/src/libs/cJSON index dbf660346..2ef742e12 160000 --- a/src/libs/cJSON +++ b/src/libs/cJSON @@ -1 +1 @@ -Subproject commit dbf660346a62c7b07a1419a5c16d4d7912aaa189 +Subproject commit 2ef742e12ea5f0d14f769e6dcd1ca3f6ff352765 diff --git a/src/platform/pic32/ble.cpp b/src/platform/pic32/ble.cpp index 3871c363d..d078d1bcb 100644 --- a/src/platform/pic32/ble.cpp +++ b/src/platform/pic32/ble.cpp @@ -382,7 +382,7 @@ void HCI_Event_CB(void *pckt) break; case EVT_BLUE_L2CAP_CONN_UPD_RESP: { - evt_l2cap_conn_upd_resp *resp = (evt_l2cap_conn_upd_resp*)blue_evt->data; + //evt_l2cap_conn_upd_resp *resp = (evt_l2cap_conn_upd_resp*)blue_evt->data; //debug("L2CAP Updated Response:%d",resp->result); send_l2cap_request = false; } @@ -507,8 +507,8 @@ uint8_t ST_BLE_Get_Version(uint8_t *hwVersion, uint16_t *fwVersion) bool openxc::interface::ble::initialize(BleDevice* device) { uint8_t ret; - uint32_t timer; - uint8_t macadd[10]; + //uint32_t timer; + // uint8_t macadd[10]; uint8_t hwVersion; uint16_t fwVersion; diff --git a/src/platform/pic32/blueNRG.c b/src/platform/pic32/blueNRG.c index 45af47d5e..67b7ba03a 100644 --- a/src/platform/pic32/blueNRG.c +++ b/src/platform/pic32/blueNRG.c @@ -28,7 +28,7 @@ uint8_t stickyfisr = 0; #ifdef BLE_SUPPORT -void __ISR(_EXTERNAL_0_VECTOR, ipl7) INT0Interrupt() +void __ISR(_EXTERNAL_0_VECTOR, ipl7AUTO) INT0Interrupt() { mINT0ClearIntFlag(); @@ -72,6 +72,7 @@ int8_t BlueNRG_SpiInit(void) { int BlueNRG_ISRDeInit(void){ BlueNRG_SPI_IRQ_Suspend();//should we float input? + return (0); } int BlueNRG_ISRInit(void){ diff --git a/src/platform/pic32/hci.c b/src/platform/pic32/hci.c index 95d88963b..73785140c 100644 --- a/src/platform/pic32/hci.c +++ b/src/platform/pic32/hci.c @@ -41,7 +41,7 @@ uint8_t HCI_Process_buffer[HCI_READ_PACKET_SIZE]; volatile BOOL ISRDevice_busy = FALSE; -void __debug_hci(const unsigned char *s); //comment this if unimplemented +void __debug_hci( char *s); //comment this if unimplemented void Disable_SPI_IRQ(void) @@ -114,7 +114,7 @@ int HCI_Process(void) { while(BlueNRG_DataPresent()) { - __debug_hci("Data too fast"); + __debug_hci("Data too fast"); data_len = BlueNRG_SPI_Read_All(HCI_Process_buffer, HCI_READ_PACKET_SIZE); @@ -1180,4 +1180,4 @@ int hci_le_test_end(uint16_t *num_pkts) return 0; } -#endif \ No newline at end of file +#endif diff --git a/src/platform/pic32/nvm.cpp b/src/platform/pic32/nvm.cpp index 72f097b7f..31a3c4031 100644 --- a/src/platform/pic32/nvm.cpp +++ b/src/platform/pic32/nvm.cpp @@ -18,12 +18,12 @@ static _EEPROM* eeprom = (_EEPROM*)NVM_START; void openxc::nvm::store() { unsigned int i = 0; - unsigned int writeWord; + //unsigned int writeWord; unsigned int* config = (unsigned int*)&(getConfiguration()->telit->config); eraseFlashPage((void*)NVM_START); - writeFlashWord((void*)NVM_START+i, (unsigned int)0x00000000); + writeFlashWord((unsigned char*)NVM_START+i, (unsigned int)0x00000000); while(i < sizeof(ModemConfigurationDescriptor)) { - writeFlashWord((void*)NVM_START+i+4, *(unsigned int*)config); + writeFlashWord((unsigned char*)NVM_START+i+4, *(unsigned int*)config); config++; i += 4; } diff --git a/src/platform/pic32/pic32.mk b/src/platform/pic32/pic32.mk index b1237e344..3ecdf6457 100644 --- a/src/platform/pic32/pic32.mk +++ b/src/platform/pic32/pic32.mk @@ -110,12 +110,13 @@ LOCAL_CPP_SRCS = $(CROSSPLATFORM_CPP_SRCS) $(wildcard platform/pic32/*.cpp) ifeq ($(PLATFORM), CROSSCHASM_C5_BLE) CPPFLAGS += -I$(LIBS_PATH)/STBTLE \ + -Werror \ -Iplatform/pic32 \ -I../dependencies/mpide/hardware/pic32/libraries/EEPROM/utility \ -Iinterface -DBLUENRG_MS \ -Iplatform/pic32/ringbuffer -CFLAGS += -I$(LIBS_PATH)/STBTLE -Iplatform/pic32 -DBLUENRG_MS -Iplatform/pic32/ringbuffer +CFLAGS += -Werror -I$(LIBS_PATH)/STBTLE -Iplatform/pic32 -DBLUENRG_MS -Iplatform/pic32/ringbuffer LOCAL_C_SRCS += $(wildcard $(LIBS_PATH)/STBTLE/*.c) LOCAL_C_SRCS += platform/pic32/ringbuffer/ringbuffer.c @@ -127,7 +128,7 @@ endif ifeq ($(PLATFORM), CROSSCHASM_C5_CELLULAR) -CPPFLAGS += -I. -I../dependencies/mpide/hardware/pic32/libraries/EEPROM/utility -Iplatform/pic32 +CPPFLAGS += -Werror -I. -I../dependencies/mpide/hardware/pic32/libraries/EEPROM/utility -Iplatform/pic32 LOCAL_C_SRCS += $(wildcard $(MPIDE_DIR)/hardware/pic32/libraries/EEPROM/utility/*.c) LOCAL_C_SRCS += $(wildcard $(LIBS_PATH)/http-parser/http_parser.c) INCLUDE_PATHS += -I$(LIBS_PATH)/http-parser @@ -135,6 +136,7 @@ INCLUDE_PATHS += -I$(LIBS_PATH)/http-parser ifeq ($(MSD_ENABLE), 1) CPPFLAGS += -Iplatform/pic32/fs_support \ + -Werror -D__PIC32MX__ \ -D__PIC32MX \ -D__XC32__ \ @@ -148,17 +150,18 @@ LOCAL_C_SRCS += $(LIBS_PATH)/MLA/MDD_File_System/SD-SPI.c INCLUDE_PATHS += -Iplatform/pic32/fs_support INCLUDE_PATHS += -I$(LIBS_PATH)/MLA/Include -CFLAGS += -I$(LIBS_PATH)/fileio/inc -Iplatform/pic32/fs_support -I$(LIBS_PATH)/fileio/drivers/sd_spi -D__XC32__ -I$(LIBS_PATH)/MLA/Include -D__C32__ -I$(LIBS_PATH)/MLA/Include -Iplatform/pic32 +CFLAGS += -Werror -I$(LIBS_PATH)/fileio/inc -Iplatform/pic32/fs_support -I$(LIBS_PATH)/fileio/drivers/sd_spi -D__XC32__ -I$(LIBS_PATH)/MLA/Include -D__C32__ -I$(LIBS_PATH)/MLA/Include -Iplatform/pic32 endif endif ifeq ($(PLATFORM), CROSSCHASM_C5_BT) -CPPFLAGS += -I. -I../dependencies/mpide/hardware/pic32/libraries/EEPROM/utility -Iplatform/pic32 +CPPFLAGS += -Werror -I. -I../dependencies/mpide/hardware/pic32/libraries/EEPROM/utility -Iplatform/pic32 ifeq ($(MSD_ENABLE), 1) CPPFLAGS += -Iplatform/pic32/fs_support \ + -Werror \ -D__PIC32MX__ \ -D__PIC32MX \ -D__XC32__ \ @@ -172,7 +175,7 @@ LOCAL_C_SRCS += $(LIBS_PATH)/MLA/MDD_File_System/SD-SPI.c INCLUDE_PATHS += -Iplatform/pic32/fs_support INCLUDE_PATHS += -I$(LIBS_PATH)/MLA/Include -CFLAGS += -I$(LIBS_PATH)/fileio/inc -Iplatform/pic32/fs_support -I$(LIBS_PATH)/fileio/drivers/sd_spi -D__XC32__ -I$(LIBS_PATH)/MLA/Include -D__C32__ -I$(LIBS_PATH)/MLA/Include -Iplatform/pic32 +CFLAGS += -Werror-I$(LIBS_PATH)/fileio/inc -Iplatform/pic32/fs_support -I$(LIBS_PATH)/fileio/drivers/sd_spi -D__XC32__ -I$(LIBS_PATH)/MLA/Include -D__C32__ -I$(LIBS_PATH)/MLA/Include -Iplatform/pic32 endif endif diff --git a/src/platform/pic32/ringbuffer/ringbuffer.c b/src/platform/pic32/ringbuffer/ringbuffer.c index 573442378..eda40890b 100644 --- a/src/platform/pic32/ringbuffer/ringbuffer.c +++ b/src/platform/pic32/ringbuffer/ringbuffer.c @@ -1,6 +1,6 @@ #include "ringbuffer.h" -#warning "reader and writer may only write the tail and head, respectively, but they do read the other's pointer....no guarantee this is atomic!...are locks the only solution or is the sequence LW-LW-SW ok?" +//#warning "reader and writer may only write the tail and head, respectively, but they do read the other's pointer....no guarantee this is atomic!...are locks the only solution or is the sequence LW-LW-SW ok?" void RingBuffer_Initialize(RingBuffer_t* ring, char* data, uint32_t size) { ring->head = 0; @@ -92,4 +92,4 @@ uint32_t RingBuffer_UsedSpace(RingBuffer_t* ring) { void RingBuffer_Clear(RingBuffer_t* ring) { ring->head = 0; ring->tail = 0; -} \ No newline at end of file +} diff --git a/src/platform/pic32/rtc.c b/src/platform/pic32/rtc.c index c3760c200..f52d29d3c 100644 --- a/src/platform/pic32/rtc.c +++ b/src/platform/pic32/rtc.c @@ -13,6 +13,7 @@ volatile ts syst; static uint32_t last_time_check; void RTC_IsrTimeVarUpdate(void); static uint8_t timer_deinit = 0; +void __debug(); #ifdef RTC_SUPPORT void __ISR(_TIMER_2_VECTOR,ipl2) _TIMER2_HANDLER(void) { @@ -88,4 +89,4 @@ void rtc_timer_ms_deinit(void){ ConfigIntTimer2( T2_INT_OFF); //disable interrupts timer_deinit = 1; } -#endif \ No newline at end of file +#endif diff --git a/src/platform/pic32/rtcc.c b/src/platform/pic32/rtcc.c index 990d2d677..0cf04e69c 100644 --- a/src/platform/pic32/rtcc.c +++ b/src/platform/pic32/rtcc.c @@ -23,9 +23,11 @@ RTCC_STATUS I2C_Acknowledge_ACK(void); RTCC_STATUS I2C_Acknowledge_NACK(void); RTCC_STATUS I2C_Receive(void); RTCC_STATUS I2C_Transmit(uint8_t data); +RTCC_STATUS I2C_Initialize(); -/*PUBLIC FUNCTIONS*/ +/*PUBLIC FUNCTIONS*/ +void __debug(); static void delay_ms(uint32_t d) { @@ -280,7 +282,7 @@ RTCC_STATUS RTCC_WriteBytes(RTCC_MEMTYPE memtype, uint8_t address, uint8_t lengt // return code RTCC_STATUS stat = RTCC_NO_ERROR; // write cycle delay time - uint32_t writecycledelay; + //uint32_t writecycledelay; // validate read address and read length if(memtype == RTCC_MEMTYPE_SRAM) @@ -590,10 +592,10 @@ RTCC_STATUS RTCCGetPowerDownTimestampBCD(struct tm * TimeDate) { // return code RTCC_STATUS stat; // packed data structure - char TimestampRegisters[4]; + unsigned char TimestampRegisters[4]; // read the time, date, and settings registers from the RTCC - stat = RTCC_ReadBytes(RTCC_MEMTYPE_SRAM, RTCC_POWERDOWN_STARTADDR, 4, TimestampRegisters); + stat = RTCC_ReadBytes(RTCC_MEMTYPE_SRAM, RTCC_POWERDOWN_STARTADDR, 4,TimestampRegisters); if(stat != RTCC_NO_ERROR) goto fcn_exit; // unpack the registers into the calling function tm struct @@ -640,7 +642,7 @@ RTCC_STATUS RTCCGetPowerUpTimestampBCD(struct tm * TimeDate) { // return code RTCC_STATUS stat; // packed data structure - char TimestampRegisters[4]; + unsigned char TimestampRegisters[4]; // read the time, date, and settings registers from the RTCC stat = RTCC_ReadBytes(RTCC_MEMTYPE_SRAM, RTCC_POWERUP_STARTADDR, 4, TimestampRegisters); @@ -1029,7 +1031,7 @@ RTCC_STATUS I2C_Start() { // block until start sequence is complete dms = millis(); //while(I2C1CONbits.SEN); - uint32_t s = status & I2C_START; + //uint32_t s = status & I2C_START; while((status & I2C_START) == 0) { status = I2CGetStatus(RTCC_I2C_MODULE); @@ -1060,7 +1062,7 @@ RTCC_STATUS I2C_Restart() { // block until restart sequence is complete dms = millis(); //while(I2C5CONbits.RSEN) - uint32_t s = status & I2C_START; + //uint32_t s = status & I2C_START; while((status & I2C_START) == 0) { status = I2CGetStatus(RTCC_I2C_MODULE); @@ -1076,7 +1078,7 @@ RTCC_STATUS I2C_Restart() { RTCC_STATUS I2C_Stop() { - I2C_RESULT res = I2C_SUCCESS; + //I2C_RESULT res = I2C_SUCCESS; uint32_t dms; // start I2C stop sequence @@ -1099,7 +1101,7 @@ RTCC_STATUS I2C_Stop() { RTCC_STATUS I2C_Receive() { - I2C_RESULT res = I2C_SUCCESS; + //I2C_RESULT res = I2C_SUCCESS; uint32_t dms; // start I2C receive sequence @@ -1126,7 +1128,7 @@ RTCC_STATUS I2C_Receive() { RTCC_STATUS I2C_Acknowledge_ACK() { - I2C_RESULT res = I2C_SUCCESS; + // I2C_RESULT res = I2C_SUCCESS; uint32_t dms; // set acknowledge type ACK @@ -1153,7 +1155,7 @@ RTCC_STATUS I2C_Acknowledge_ACK() { RTCC_STATUS I2C_Acknowledge_NACK() { - I2C_RESULT res = I2C_SUCCESS; + // I2C_RESULT res = I2C_SUCCESS; uint32_t dms; // set acknowledge type NACK diff --git a/src/platform/pic32/telit_he910.cpp b/src/platform/pic32/telit_he910.cpp index 2635deaef..33576df4e 100644 --- a/src/platform/pic32/telit_he910.cpp +++ b/src/platform/pic32/telit_he910.cpp @@ -61,7 +61,7 @@ static TELIT_CONNECTION_STATE state = telit::POWER_OFF; /*PRIVATE FUNCTIONS*/ static bool autobaud(openxc::telitHE910::TelitDevice* device); -static void telit_setIoDirection(void); + void telit_setIoDirection(void); static void setPowerState(bool enable); static bool sendCommand(TelitDevice* device, const char* command, const char* response, uint32_t timeoutMs); static bool sendCommand(TelitDevice* device, const char* command, const char* response, const char* error, uint32_t timeoutMs); @@ -1307,7 +1307,7 @@ static bool getResponse(const char* startToken, const char* stopToken, char* res goto fcn_exit; } p1 += strlen(startToken); - memcpy(response, p1, (maxLen < p2-p1) ? (maxLen) : (p2-p1)); + memcpy(response, p1, (maxLen < (unsigned int)(p2-p1)) ? (maxLen) : (p2-p1)); fcn_exit: return rc; @@ -1333,7 +1333,7 @@ static void sendData(TelitDevice* device, char* data, unsigned int len) { // Only want to set the directly once because it flips the power on/off. #ifdef TELIT_HE910_ENABLE_SUPPORT -static void telit_setIoDirection() { + void telit_setIoDirection() { static bool directionSet = false; if(!directionSet) { // be aware that setting the direction here will default it to the off diff --git a/src/platform/pic32/usb.cpp b/src/platform/pic32/usb.cpp index 34a6a82e5..f3f7a7f6d 100644 --- a/src/platform/pic32/usb.cpp +++ b/src/platform/pic32/usb.cpp @@ -65,8 +65,9 @@ boolean usbCallback(USB_EVENT event, void *pdata, word size) { #endif getConfiguration()->usb.device.DefaultCBEventHandler(event, pdata, size); - - switch(event) { + int temp = (USB_EVENT)event; + switch(temp) { + case EVENT_CONFIGURED: debug("USB Configured"); getConfiguration()->usb.configured = true; @@ -223,7 +224,7 @@ void openxc::interface::usb::read(UsbDevice* device, UsbEndpoint* endpoint, !device->device.HandleBusy(endpoint->hostToDeviceHandle)) { size_t length = device->device.HandleGetLength( endpoint->hostToDeviceHandle); - for(int i = 0; i < endpoint->size && i < length; i++) { + for(unsigned int i = 0; i < endpoint->size && i < length; i++) { if(!QUEUE_PUSH(uint8_t, &endpoint->queue, endpoint->receiveBuffer[i])) { debug("Dropped write from host -- queue is full"); diff --git a/src/platform/pic32/usb_config.c b/src/platform/pic32/usb_config.c index 998d5be78..dcd90f0e5 100644 --- a/src/platform/pic32/usb_config.c +++ b/src/platform/pic32/usb_config.c @@ -6,6 +6,13 @@ #include "USB/usb_function_msd.h" #endif +#ifdef ROM +#undef ROM +#define ROM +#else +#define ROM +#endif + ROM USB_DEVICE_DESCRIPTOR device_dsc_gen= { sizeof(USB_DEVICE_DESCRIPTOR), @@ -170,7 +177,7 @@ sizeof(sd006),USB_DESCRIPTOR_STRING, ROM USB_DEVICE_DESCRIPTOR device_dsc; ROM USB_DEVICE_DESCRIPTOR *device_dsc_user = &device_dsc_gen;; ROM BYTE *USB_CD_Ptr[1] = {configDescriptor_gen}; -ROM BYTE *USB_SD_Ptr[4] = {&sd000,&sd001,&sd002,NULL}; +ROM BYTE *USB_SD_Ptr[4] = {(BYTE*)&sd000,(BYTE*)&sd001,(BYTE*)&sd002,NULL}; void SelectUsbConf(BYTE no){ switch(no){ @@ -197,4 +204,4 @@ void SelectUsbConf(BYTE no){ #endif } -} \ No newline at end of file +} diff --git a/src/tests/tests.mk b/src/tests/tests.mk index aa2ab99d7..17edff6b5 100644 --- a/src/tests/tests.mk +++ b/src/tests/tests.mk @@ -78,7 +78,7 @@ test_long: test_short test_short: unit_tests @make default_compile_test - @make msd_default_compile_test + # @make msd_default_compile_test @make debug_compile_test @make mapped_compile_test @make passthrough_compile_test @@ -118,7 +118,7 @@ unit_tests: $(TESTS) @sh tests/runtests.sh $(TEST_OBJDIR)/$(TEST_DIR) $(eval $(call ALL_PLATFORMS_TEST_TEMPLATE, default_compile_test, DEBUG=0, code_generation_test)) -$(eval $(call MSD_PLATFORMS_TEST_TEMPLATE, msd_default_compile_test, DEBUG=0 MSD_ENABLE=1, code_generation_test)) +# $(eval $(call MSD_PLATFORMS_TEST_TEMPLATE, msd_default_compile_test, DEBUG=0 MSD_ENABLE=1, code_generation_test)) $(eval $(call ALL_PLATFORMS_TEST_TEMPLATE, diag_compile_test, DEBUG=0, diagnostic_code_generation_test)) $(eval $(call MSD_PLATFORMS_TEST_TEMPLATE, msd_diag_compile_test, DEBUG=0 MSD_ENABLE=1, diagnostic_code_generation_test)) $(eval $(call ALL_PLATFORMS_TEST_TEMPLATE, debug_compile_test, DEBUG=1, code_generation_test))