From 392abbe4d344b8ee3dc187cdd7103a0a18ed308e Mon Sep 17 00:00:00 2001 From: Janez Date: Mon, 15 Feb 2016 11:07:48 +0100 Subject: [PATCH] PIC32 --- stack/PIC32/CO_driver.c | 2 +- stack/PIC32/eeprom.c | 8 ++++---- stack/PIC32/main_PIC32.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stack/PIC32/CO_driver.c b/stack/PIC32/CO_driver.c index 95289b7..e3b3f71 100644 --- a/stack/PIC32/CO_driver.c +++ b/stack/PIC32/CO_driver.c @@ -297,7 +297,7 @@ CO_ReturnError_t CO_CANrxBufferInit( pRXM1 = &CAN_REG(addr, C_RXM+0x10); pRXM2 = &CAN_REG(addr, C_RXM+0x20); pRXM3 = &CAN_REG(addr, C_RXM+0x30); - if(RXM == 0xFFE80000){ + if(RXM == *pRXM0){ selectMask = 0; } else if(RXM == *pRXM1 || *pRXM1 == 0xFFE80000){ diff --git a/stack/PIC32/eeprom.c b/stack/PIC32/eeprom.c index 095094f..3ebc701 100644 --- a/stack/PIC32/eeprom.c +++ b/stack/PIC32/eeprom.c @@ -70,6 +70,8 @@ static void EE_writeStatus(uint8_t data); static uint8_t EE_readStatus(); #define EE_isWriteInProcess() (EE_readStatus() & 0x01) /* True if write is in process. */ +static uint32_t tmpU32; + /* Store parameters ***********************************************************/ static CO_SDO_abortCode_t CO_ODF_1010(CO_ODF_arg_t *ODF_arg){ @@ -186,7 +188,6 @@ CO_ReturnError_t CO_EE_init_1( uint8_t *OD_ROMAddress, uint32_t OD_ROMSize) { - uint32_t rdata; /* verify arguments */ if(ee==NULL || OD_EEPROMAddress==NULL || OD_ROMAddress==NULL){ @@ -196,7 +197,7 @@ CO_ReturnError_t CO_EE_init_1( /* Configure SPI port for use with eeprom */ SPICON = 0; /* Stops and restes the SPI */ SPISTAT = 0; - rdata = SPIBUF; /* Clear the receive buffer */ + tmpU32 = SPIBUF; /* Clear the receive buffer */ SPIBRG = 4; /* Clock = FPB / ((4+1) * 2) */ SPICON = 0x00018120; /* MSSEN = 0 - Master mode slave select enable bit */ /* ENHBUF(bit16) = 1 - Enhanced buffer enable bit */ @@ -320,10 +321,9 @@ static void EE_SPIwrite(uint8_t *tx, uint8_t *rx, uint8_t len){ /* read bytes from SPI_RXB fifo buffer */ for(i=0; i