Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Werror #460

Open
wants to merge 10 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libs/STBTLE
Submodule STBTLE updated 1 files
+1 −1 bluenrg_gap_aci.c
2 changes: 1 addition & 1 deletion src/libs/cJSON
Submodule cJSON updated 1 files
+1 −1 cJSON.c
6 changes: 3 additions & 3 deletions src/platform/pic32/ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion src/platform/pic32/blueNRG.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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){
Expand Down
6 changes: 3 additions & 3 deletions src/platform/pic32/hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -1180,4 +1180,4 @@ int hci_le_test_end(uint16_t *num_pkts)

return 0;
}
#endif
#endif
6 changes: 3 additions & 3 deletions src/platform/pic32/nvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
13 changes: 8 additions & 5 deletions src/platform/pic32/pic32.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -127,14 +128,15 @@ 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

ifeq ($(MSD_ENABLE), 1)

CPPFLAGS += -Iplatform/pic32/fs_support \
-Werror
-D__PIC32MX__ \
-D__PIC32MX \
-D__XC32__ \
Expand All @@ -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__ \
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/platform/pic32/ringbuffer/ringbuffer.c
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -92,4 +92,4 @@ uint32_t RingBuffer_UsedSpace(RingBuffer_t* ring) {
void RingBuffer_Clear(RingBuffer_t* ring) {
ring->head = 0;
ring->tail = 0;
}
}
3 changes: 2 additions & 1 deletion src/platform/pic32/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -88,4 +89,4 @@ void rtc_timer_ms_deinit(void){
ConfigIntTimer2( T2_INT_OFF); //disable interrupts
timer_deinit = 1;
}
#endif
#endif
24 changes: 13 additions & 11 deletions src/platform/pic32/rtcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/platform/pic32/telit_he910.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/platform/pic32/usb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
11 changes: 9 additions & 2 deletions src/platform/pic32/usb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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){
Expand All @@ -197,4 +204,4 @@ void SelectUsbConf(BYTE no){
#endif
}

}
}
4 changes: 2 additions & 2 deletions src/tests/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down