From 97b9e38665088c80062157a1797134f4f7855161 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 25 Aug 2023 22:53:04 +0200 Subject: [PATCH 01/50] reconnect after death --- 306-controller_interface.X/app/can_message.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index a746c18..468cc93 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -33,6 +33,10 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0xF) { // JOY_ALIVE ALIVE_CHECKER_ISALIVE(ACjoy()); + if(ACjoy()->state == STAC_DEAD){ + ALIVE_CHECKER_emitBorn(ACjoy(), 0, 0); + ALIVE_CHECKER_emitReady(ACjoy(), 100, 0); + } } break; From 5bbc7bc0c3b9422626ff5a3a65bb547b992849fe Mon Sep 17 00:00:00 2001 From: Klagarge Date: Sun, 27 Aug 2023 17:39:45 +0200 Subject: [PATCH 02/50] add EEPROM file --- 306-controller_interface.X/app/can_message.c | 1 + .../middleware/eeprom_interface.c | 8 ++ .../middleware/eeprom_interface.h | 15 ++++ .../nbproject/configurations.xml | 2 + 306-controller_interface.X/ss22ep.mc3 | 90 +++++++++---------- 5 files changed, 71 insertions(+), 45 deletions(-) create mode 100644 306-controller_interface.X/middleware/eeprom_interface.c create mode 100644 306-controller_interface.X/middleware/eeprom_interface.h diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 468cc93..b9b7348 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -5,6 +5,7 @@ * @file can_message.c */ +#include "can_message.h" #include "../middleware/can_interface.h" #include "car.h" #include "../app/factory/factory.h" diff --git a/306-controller_interface.X/middleware/eeprom_interface.c b/306-controller_interface.X/middleware/eeprom_interface.c new file mode 100644 index 0000000..9a628f5 --- /dev/null +++ b/306-controller_interface.X/middleware/eeprom_interface.c @@ -0,0 +1,8 @@ +/** + * @author Rémi Heredero + * @version 1.0.0 + * @date August 2023 + * @file eeprom_interface.h + */ + +#include "eeprom_interface.h" diff --git a/306-controller_interface.X/middleware/eeprom_interface.h b/306-controller_interface.X/middleware/eeprom_interface.h new file mode 100644 index 0000000..0a7e728 --- /dev/null +++ b/306-controller_interface.X/middleware/eeprom_interface.h @@ -0,0 +1,15 @@ +/** + * @author Rémi Heredero + * @version 1.0.0 + * @date August 2023 + * @file eeprom_interface.h + */ +#ifndef EEPROM_INTERFACE_H +#define EEPROM_INTERFACE_H + +MEM_write_1_byte(uint8_t addresse, uint8_t data); +MEM_write_4_byte(uint32_t data); +// void MEM_write_CONTROL_STEERING_MODE(uint8_t data); + +#endif /* EEPROM_INTERFACE_H */ + diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 4b844cc..ce03b10 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -27,6 +27,7 @@ middleware/can_interface.h middleware/alive_checker.h middleware/watchdog.h + middleware/eeprom_interface.h xf/event.h @@ -63,6 +64,7 @@ middleware/can_interface.c middleware/alive_checker.c middleware/watchdog.c + middleware/eeprom_interface.c xf/event.c diff --git a/306-controller_interface.X/ss22ep.mc3 b/306-controller_interface.X/ss22ep.mc3 index 6fedf69..9fc2a6a 100644 --- a/306-controller_interface.X/ss22ep.mc3 +++ b/306-controller_interface.X/ss22ep.mc3 @@ -1,4 +1,4 @@ - + @@ -1948,7 +1948,7 @@ - {"dataArray":[{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL1","value":"false"},"id":"DMA Channels_rowCount_0"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,TMR0,ECAN,MEMORY","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_0"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_0"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_0"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"id":"Src VarName_rowCount_0"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_0","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"},"id":"Src Address_rowCount_0","Src Address":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_0"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_0"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,TMR0,ECAN,MEMORY","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_0"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_0"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_0"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"id":"Dst VarName_rowCount_0"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_0","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_0"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_0"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Start Trigger_rowCount_0"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Abort Trigger_rowCount_0","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}},{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL2","value":"false"},"id":"DMA Channels_rowCount_1"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,TMR0,ECAN,MEMORY","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_1"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_1"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_1"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"id":"Src VarName_rowCount_1"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_1","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"},"id":"Src Address_rowCount_1","Src Address":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_1"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_1"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,TMR0,ECAN,MEMORY","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_1"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_1"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_1"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"id":"Dst VarName_rowCount_1"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_1","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_1"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_1"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Start Trigger_rowCount_1"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Abort Trigger_rowCount_1","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}}],"type":"tableDynamicControls","key":"dmaTable"} + {"dataArray":[{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL1","value":"false"},"id":"DMA Channels_rowCount_0"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,ECAN,MEMORY,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_0"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_0"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_0"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"id":"Src VarName_rowCount_0"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_0","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"},"id":"Src Address_rowCount_0","Src Address":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_0"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_0"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,ECAN,MEMORY,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_0"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_0"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_0"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"id":"Dst VarName_rowCount_0"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_0","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_0"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_0"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Start Trigger_rowCount_0"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Abort Trigger_rowCount_0","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}},{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL2","value":"false"},"id":"DMA Channels_rowCount_1"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,ECAN,MEMORY,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_1"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_1"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_1"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"id":"Src VarName_rowCount_1"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_1","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"},"id":"Src Address_rowCount_1","Src Address":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_1"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_1"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,ECAN,MEMORY,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_1"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_1"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_1"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"id":"Dst VarName_rowCount_1"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_1","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_1"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_1"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Start Trigger_rowCount_1"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_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","text":"None","value":"None"}}}],"type":"tableDynamicControls","key":"dmaTable"} @@ -17159,7 +17159,27 @@ Window delay time 87.5% - + + + mcc_generated_files\interrupt_manager.h + 313560861c27e0a0b39b2bbb6a64ac2068fd1937dc0339d7303ff241bbb52955 + + + mcc_generated_files\mcc.h + aead6835bc73f4332d9abb5de6c2a40829de25cc98452c4c69960d51b52844e9 + + + mcc_generated_files\device_config.h + 2f04b3ff01bbe49769634d389433c7010ffb45d0f2973898e33988be7ab07d56 + + + mcc_generated_files\memory.c + ae2dbb373f8f03dd013cde153de046ba7c3c41033c1dedb8545cde41837ca3da + + + mcc_generated_files\tmr0.h + 68e2ba0f47166abd2da1a472d6a67bfde31f9be3edc8582ace93062a6a32f441 + main.c 91afd5df6694cfcd0279d66d9b5b3eb72a9c4eae825f0c0af82824e2ee66e35e @@ -17168,46 +17188,6 @@ mcc_generated_files\device_config.c 4288704a051756dce8bb92e77a82ba1285fc638cde56b3676b59406ba0fcea7b - - mcc_generated_files\device_config.h - 2f04b3ff01bbe49769634d389433c7010ffb45d0f2973898e33988be7ab07d56 - - - mcc_generated_files\ecan.c - b60a119876875a2af386474d32176b8be0f47a074a2d8688e79251a2d7cdf6fa - - - mcc_generated_files\ecan.h - 0473fedf57d1376193e049ba507abed0960af84f0e416bea25972c4dae59ca26 - - - mcc_generated_files\interrupt_manager.c - bb0eaf9aec0554de0106cff27f66e56ae02a40bbdcb68d4d58d8a0d84d8929f6 - - - mcc_generated_files\interrupt_manager.h - 313560861c27e0a0b39b2bbb6a64ac2068fd1937dc0339d7303ff241bbb52955 - - - mcc_generated_files\mcc.c - 34fadc3a271040b358215ec477acf3e135b77137f9a1cc96def75fc2936d3ad6 - - - mcc_generated_files\mcc.h - aead6835bc73f4332d9abb5de6c2a40829de25cc98452c4c69960d51b52844e9 - - - mcc_generated_files\memory.c - ae2dbb373f8f03dd013cde153de046ba7c3c41033c1dedb8545cde41837ca3da - - - mcc_generated_files\memory.h - 77a34d015c961db9ed465b4ca2d85ba910fb030ca14c3c2854428ab0b9b6fac2 - - - mcc_generated_files\pin_manager.c - f8ace8a0b0d2a4f0ed3e209db056da57858e5a670ad7d514e44352d9187be806 - mcc_generated_files\pin_manager.h 3e61569926ed5f184a2267965f2cf7ca26dc997d552c213ebd94dbd80da54891 @@ -17217,8 +17197,28 @@ f9702dc8c67433ffc3b8db9e12ee3a73fb0b152a792d26f6c7a89a3846bc4fc9 - mcc_generated_files\tmr0.h - 68e2ba0f47166abd2da1a472d6a67bfde31f9be3edc8582ace93062a6a32f441 + mcc_generated_files\pin_manager.c + f8ace8a0b0d2a4f0ed3e209db056da57858e5a670ad7d514e44352d9187be806 + + + mcc_generated_files\ecan.c + b60a119876875a2af386474d32176b8be0f47a074a2d8688e79251a2d7cdf6fa + + + mcc_generated_files\interrupt_manager.c + bb0eaf9aec0554de0106cff27f66e56ae02a40bbdcb68d4d58d8a0d84d8929f6 + + + mcc_generated_files\mcc.c + 34fadc3a271040b358215ec477acf3e135b77137f9a1cc96def75fc2936d3ad6 + + + mcc_generated_files\ecan.h + 0473fedf57d1376193e049ba507abed0960af84f0e416bea25972c4dae59ca26 + + + mcc_generated_files\memory.h + 77a34d015c961db9ed465b4ca2d85ba910fb030ca14c3c2854428ab0b9b6fac2 \ No newline at end of file From 2b31ef5c0643b493627da73325cc8a01d2b08fa0 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Sun, 27 Aug 2023 21:35:19 +0200 Subject: [PATCH 03/50] implement POC for EEPROM --- 306-controller_interface.X/app/can_message.c | 5 ++++ 306-controller_interface.X/app/can_message.h | 3 ++ .../app/factory/factory.c | 17 +++++++---- .../app/factory/factory.h | 1 + .../middleware/eeprom_interface.c | 30 ++++++++++++++++++- .../middleware/eeprom_interface.h | 12 ++++++-- .../nbproject/configurations.xml | 1 + 306-controller_interface.X/ss22ep.mc3 | 4 +-- 8 files changed, 61 insertions(+), 12 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index b9b7348..9030894 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -35,6 +35,11 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0xF) { // JOY_ALIVE ALIVE_CHECKER_ISALIVE(ACjoy()); if(ACjoy()->state == STAC_DEAD){ + CAR_CST.JOYSTICK_MODE = MEM_read_one_byte(MEMADD_JOYSTICK_MODE); + CAR_CST.JOYSTICK_PARAM1 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM1); + CAR_CST.JOYSTICK_PARAM2 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM2); + CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_one_byte(MEMADD_JOYSTICK_ALIVE_TIME); + ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); ALIVE_CHECKER_emitBorn(ACjoy(), 0, 0); ALIVE_CHECKER_emitReady(ACjoy(), 100, 0); } diff --git a/306-controller_interface.X/app/can_message.h b/306-controller_interface.X/app/can_message.h index cfec699..5e39140 100644 --- a/306-controller_interface.X/app/can_message.h +++ b/306-controller_interface.X/app/can_message.h @@ -8,6 +8,9 @@ #ifndef CAN_MESSAGE_H #define CAN_MESSAGE_H +#include // usage of standard types +#include // usage of boolean types +#include "../mcc_generated_files/mcc.h" /* S R M diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index 2f62bfd..b381255 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -67,14 +67,19 @@ void Factory_init() { // TODO init watchdog with EPROM CST WATCHDOG_init(WDcontroller()); - CAR_CST.CONTROL_ALIVE_TIME = 100; + MEM_write_one_byte(MEMADD_CONTROL_ALIVE_TIME, 10); + + CAR_CST.CONTROL_ALIVE_TIME = MEM_read_one_byte(MEMADD_CONTROL_ALIVE_TIME); WATCHDOG_setTime(WDcontroller(), CAR_CST.CONTROL_ALIVE_TIME); - // TODO init ALIVE CHECKER with EPROM CST - CAR_CST.JOYSTICK_MODE = 0; - CAR_CST.JOYSTICK_PARAM1 = 100; - CAR_CST.JOYSTICK_PARAM2 = 1; - CAR_CST.JOYSTICK_ALIVE_TIME = 10; + MEM_write_one_byte(MEMADD_JOYSTICK_MODE, 0); + MEM_write_one_byte(MEMADD_JOYSTICK_PARAM1, 100); + MEM_write_one_byte(MEMADD_JOYSTICK_PARAM2, 1); + MEM_write_one_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME); + CAR_CST.JOYSTICK_MODE = MEM_read_one_byte(MEMADD_JOYSTICK_MODE); + CAR_CST.JOYSTICK_PARAM1 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM1); + CAR_CST.JOYSTICK_PARAM2 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM2); + CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_one_byte(MEMADD_JOYSTICK_ALIVE_TIME); ALIVE_CHECKER_init(ACjoy()); } diff --git a/306-controller_interface.X/app/factory/factory.h b/306-controller_interface.X/app/factory/factory.h index 015a4ba..7b21e07 100644 --- a/306-controller_interface.X/app/factory/factory.h +++ b/306-controller_interface.X/app/factory/factory.h @@ -19,6 +19,7 @@ #include "../../middleware/alive_checker.h" #include "../../middleware/can_interface.h" #include "../../middleware/watchdog.h" +#include "../../middleware/eeprom_interface.h" typedef struct { diff --git a/306-controller_interface.X/middleware/eeprom_interface.c b/306-controller_interface.X/middleware/eeprom_interface.c index 9a628f5..7feb700 100644 --- a/306-controller_interface.X/middleware/eeprom_interface.c +++ b/306-controller_interface.X/middleware/eeprom_interface.c @@ -1,8 +1,36 @@ /** - * @author Rémi Heredero + * @author R�mi Heredero * @version 1.0.0 * @date August 2023 * @file eeprom_interface.h */ #include "eeprom_interface.h" + +typedef union { + struct { + uint8_t byte0; + uint8_t byte1; + uint8_t byte2; + uint8_t byte3; + } separate; + struct { + uint32_t bytes; + } full; +} BYTES_4; + +void MEM_write_one_byte(uint8_t addresse, uint8_t data) { + DATAEE_WriteByte(addresse, data); +} + +void MEM_write_four_byte(uint8_t addresse, uint32_t data) { + +} + +uint8_t MEM_read_one_byte(uint8_t adresse) { + return DATAEE_ReadByte(adresse); +} + +uint32_t MEM_read_four_byte(uint8_t adresse) { + +} diff --git a/306-controller_interface.X/middleware/eeprom_interface.h b/306-controller_interface.X/middleware/eeprom_interface.h index 0a7e728..d0f30a2 100644 --- a/306-controller_interface.X/middleware/eeprom_interface.h +++ b/306-controller_interface.X/middleware/eeprom_interface.h @@ -1,5 +1,5 @@ /** - * @author Rémi Heredero + * @author R�mi Heredero * @version 1.0.0 * @date August 2023 * @file eeprom_interface.h @@ -7,8 +7,14 @@ #ifndef EEPROM_INTERFACE_H #define EEPROM_INTERFACE_H -MEM_write_1_byte(uint8_t addresse, uint8_t data); -MEM_write_4_byte(uint32_t data); +#include // usage of standard types +#include // usage of boolean types +#include "../mcc_generated_files/mcc.h" + +void MEM_write_one_byte(uint8_t addresse, uint8_t data); +void MEM_write_four_byte(uint8_t adresse, uint32_t data); +uint8_t MEM_read_one_byte(uint8_t adresse); +uint32_t MEM_read_four_byte(uint8_t adresse); // void MEM_write_CONTROL_STEERING_MODE(uint8_t data); #endif /* EEPROM_INTERFACE_H */ diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index ce03b10..858a8fd 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -8,6 +8,7 @@ app/factory/factory.h app/car.h app/can_message.h + middleware/eeprom_interface.h board/led/led.h diff --git a/306-controller_interface.X/ss22ep.mc3 b/306-controller_interface.X/ss22ep.mc3 index 9fc2a6a..545a479 100644 --- a/306-controller_interface.X/ss22ep.mc3 +++ b/306-controller_interface.X/ss22ep.mc3 @@ -1,4 +1,4 @@ - + @@ -1948,7 +1948,7 @@ - {"dataArray":[{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL1","value":"false"},"id":"DMA Channels_rowCount_0"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,ECAN,MEMORY,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_0"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_0"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_0"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"id":"Src VarName_rowCount_0"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_0","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"},"id":"Src Address_rowCount_0","Src Address":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_0"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_0"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,ECAN,MEMORY,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_0"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_0"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_0"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"id":"Dst VarName_rowCount_0"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_0","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_0"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_0"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB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abort Trigger_rowCount_0","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}},{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL2","value":"false"},"id":"DMA Channels_rowCount_1"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,ECAN,MEMORY,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_1"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_1"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_1"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"id":"Src VarName_rowCount_1"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_1","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"},"id":"Src Address_rowCount_1","Src Address":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_1"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_1"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,ECAN,MEMORY,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_1"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_1"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_1"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"id":"Dst VarName_rowCount_1"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_1","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_1"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_1"},"Start Trigger":{"Start Trigger":{"isDisable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","value":"None"},"id":"Start Trigger_rowCount_1"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Abort Trigger_rowCount_1","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}}],"type":"tableDynamicControls","key":"dmaTable"} + {"dataArray":[{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL1","value":"false"},"id":"DMA Channels_rowCount_0"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_0"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_0"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_0"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"id":"Src VarName_rowCount_0"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_0","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"},"id":"Src Address_rowCount_0","Src Address":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_0"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_0"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_0"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_0"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_0"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"id":"Dst VarName_rowCount_0"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_0","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_0"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_0"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Start Trigger_rowCount_0"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Abort Trigger_rowCount_0","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}},{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL2","value":"false"},"id":"DMA Channels_rowCount_1"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_1"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_1"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_1"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"id":"Src VarName_rowCount_1"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_1","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"},"id":"Src Address_rowCount_1","Src Address":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_1"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_1"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_1"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_1"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_1"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"id":"Dst VarName_rowCount_1"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_1","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_1"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_1"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Start Trigger_rowCount_1"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Abort Trigger_rowCount_1","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}}],"type":"tableDynamicControls","key":"dmaTable"} From 4d513277b72cd201b07118d548e1e8dfc2ff753c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 09:04:52 +0200 Subject: [PATCH 04/50] fix can byte order --- 306-controller_interface.X/middleware/can_interface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/306-controller_interface.X/middleware/can_interface.c b/306-controller_interface.X/middleware/can_interface.c index 0847b1f..6c893fd 100644 --- a/306-controller_interface.X/middleware/can_interface.c +++ b/306-controller_interface.X/middleware/can_interface.c @@ -146,13 +146,13 @@ void CAN_newMsg() { CAN_receive(&canMsg); data = canMsg.frame.id; data = data<<12; - data = data | canMsg.frame.data0; - data = data<<8; - data = data | canMsg.frame.data1; + data = data | canMsg.frame.data3; data = data<<8; data = data | canMsg.frame.data2; data = data<<8; - data = data | canMsg.frame.data3; + data = data | canMsg.frame.data1; + data = data<<8; + data = data | canMsg.frame.data0; POST(&CAN_myself, &CAN_processEvent, evCAnewMsg, 0, data); } From 9bd3e9b4dae73cbeb96aa276b5bab36e52dd9090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 09:09:54 +0200 Subject: [PATCH 05/50] implment re-write momory by CAN --- 306-controller_interface.X/app/can_message.c | 61 ++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 9030894..d8f3fe3 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -25,6 +25,67 @@ typedef union { void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ switch(idSender){ case 0: // Broadcast / Debug + /* + S R M + 0 1 0 CONTROL_SETUP steeringMode - - controlAliveTime + 0 1 1 CONTROL_SPEED_FACTOR valHH valH valL valLL + 0 1 2 CONTROL_POWER_FACTOR valHH valH valL valLL + 0 1 3 CONTROL_STEERING_FACTOR valHH valH valL valLL + 0 1 4 CONTROL_SECURITY_PARAM maxSpeedFw maxSpeedBw - - + 0 1 5 CONTROL_SETUP_PARAM displayAliveTime steeringAliveTime + 0 1 6 CONTROL_SETUP_PARAM_JOY joystickMode joystickParam1 joystickParam2 joystickAliveTime + 0 1 7 CONTROL_SETUP_PARAM_DRIVE driveAliveTime driveSpeedTime driveStopTime + 0 1 8 CONTROL_SETUP_PARAM_BATTERY batteryVoltTime batteryCurrentTime batteryEnergyTime batteryAliveTime + */ + if(idMsg == 0x0) { // CONTROL_SETUP + + } + + if(idMsg == 0x1) { // CONTROL_SPEED_FACTOR + + } + + if(idMsg == 0x2) { // CONTROL_POWER_FACTOR + + } + + if(idMsg == 0x3) { // CONTROL_STEERING_FACTOR + + } + + if(idMsg == 0x4) { // CONTROL_SECURITY_PARAM + + } + + if(idMsg == 0x5) { // CONTROL_SETUP_PARAM + + } + + if(idMsg == 0x6) { // CONTROL_SETUP_PARAM_JOY + // joystickMode joystickParam1 joystickParam2 joystickAliveTime + BYTES_4 tmpData; + tmpData.full.bytes = data; + MEM_write_one_byte(MEMADD_JOYSTICK_MODE, tmpData.separate.byte0); + MEM_write_one_byte(MEMADD_JOYSTICK_PARAM1, tmpData.separate.byte1); + MEM_write_one_byte(MEMADD_JOYSTICK_PARAM2, tmpData.separate.byte2); + MEM_write_one_byte(MEMADD_JOYSTICK_ALIVE_TIME, tmpData.separate.byte3); + CAR_CST.JOYSTICK_MODE = MEM_read_one_byte(MEMADD_JOYSTICK_MODE); + CAR_CST.JOYSTICK_PARAM1 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM1); + CAR_CST.JOYSTICK_PARAM2 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM2); + CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_one_byte(MEMADD_JOYSTICK_ALIVE_TIME); + ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); + CM_JOY_SETUP(NULL); + + } + + if(idMsg == 0x7) { // CONTROL_SETUP_PARAM_DRIVE + + } + + if(idMsg == 0x8) { // CONTROL_SETUP_PARAM_BATTERY + + } + break; case 2: // Joystick From f60b9166ca8504aef3b09bab991d4873f8d69f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 12:57:16 +0200 Subject: [PATCH 06/50] implement memory init for EEPROM --- 306-controller_interface.X/app/can_message.c | 130 +++++++++++++----- 306-controller_interface.X/app/car.h | 19 ++- .../app/factory/factory.c | 12 +- .../middleware/eeprom_interface.c | 119 ++++++++++++++-- .../middleware/eeprom_interface.h | 9 +- threewheeler.DBF | 9 +- 6 files changed, 232 insertions(+), 66 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index d8f3fe3..05f929a 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -6,9 +6,9 @@ */ #include "can_message.h" -#include "../middleware/can_interface.h" #include "car.h" #include "../app/factory/factory.h" +#include "../middleware/can_interface.h" typedef union { struct { @@ -24,40 +24,44 @@ typedef union { void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ switch(idSender){ - case 0: // Broadcast / Debug - /* - S R M - 0 1 0 CONTROL_SETUP steeringMode - - controlAliveTime - 0 1 1 CONTROL_SPEED_FACTOR valHH valH valL valLL - 0 1 2 CONTROL_POWER_FACTOR valHH valH valL valLL - 0 1 3 CONTROL_STEERING_FACTOR valHH valH valL valLL - 0 1 4 CONTROL_SECURITY_PARAM maxSpeedFw maxSpeedBw - - - 0 1 5 CONTROL_SETUP_PARAM displayAliveTime steeringAliveTime - 0 1 6 CONTROL_SETUP_PARAM_JOY joystickMode joystickParam1 joystickParam2 joystickAliveTime - 0 1 7 CONTROL_SETUP_PARAM_DRIVE driveAliveTime driveSpeedTime driveStopTime - 0 1 8 CONTROL_SETUP_PARAM_BATTERY batteryVoltTime batteryCurrentTime batteryEnergyTime batteryAliveTime - */ + + /********************* + * BROADCAST / DEBUG * + *********************/ + case 0: if(idMsg == 0x0) { // CONTROL_SETUP - + // steeringMode - - controlAliveTime + BYTES_4 tmpData; + tmpData.full.bytes = data; + CAR_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0; + CAR_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3; + MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); + MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME); + WATCHDOG_setTime(WDcontroller(), CAR_CST.CONTROL_ALIVE_TIME); } if(idMsg == 0x1) { // CONTROL_SPEED_FACTOR + // valHH valH valL valLL } if(idMsg == 0x2) { // CONTROL_POWER_FACTOR + // valHH valH valL valLL } if(idMsg == 0x3) { // CONTROL_STEERING_FACTOR + // valHH valH valL valLL } if(idMsg == 0x4) { // CONTROL_SECURITY_PARAM + // maxSpeedFw maxSpeedBw - - } if(idMsg == 0x5) { // CONTROL_SETUP_PARAM + // displayAliveTime steeringAliveTime - - } @@ -65,41 +69,50 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ // joystickMode joystickParam1 joystickParam2 joystickAliveTime BYTES_4 tmpData; tmpData.full.bytes = data; - MEM_write_one_byte(MEMADD_JOYSTICK_MODE, tmpData.separate.byte0); - MEM_write_one_byte(MEMADD_JOYSTICK_PARAM1, tmpData.separate.byte1); - MEM_write_one_byte(MEMADD_JOYSTICK_PARAM2, tmpData.separate.byte2); - MEM_write_one_byte(MEMADD_JOYSTICK_ALIVE_TIME, tmpData.separate.byte3); - CAR_CST.JOYSTICK_MODE = MEM_read_one_byte(MEMADD_JOYSTICK_MODE); - CAR_CST.JOYSTICK_PARAM1 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM1); - CAR_CST.JOYSTICK_PARAM2 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM2); - CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_one_byte(MEMADD_JOYSTICK_ALIVE_TIME); + CAR_CST.JOYSTICK_MODE = tmpData.separate.byte0; + CAR_CST.JOYSTICK_PARAM1 = tmpData.separate.byte1; + CAR_CST.JOYSTICK_PARAM2 = tmpData.separate.byte2; + CAR_CST.JOYSTICK_ALIVE_TIME = tmpData.separate.byte3; + MEM_write_1_byte(MEMADD_JOYSTICK_MODE, CAR_CST.JOYSTICK_MODE); + MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, CAR_CST.JOYSTICK_PARAM1); + MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, CAR_CST.JOYSTICK_PARAM2); + MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.JOYSTICK_ALIVE_TIME); + ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); CM_JOY_SETUP(NULL); } if(idMsg == 0x7) { // CONTROL_SETUP_PARAM_DRIVE + // driveAliveTime driveSpeedTime driveStopTime - } if(idMsg == 0x8) { // CONTROL_SETUP_PARAM_BATTERY + // batteryVoltTime batteryCurrentTime batteryEnergyTime batteryAliveTime } break; - case 2: // Joystick + + /************ + * JOYSTICK * + ************/ + case 2: if(idMsg == 0x1) { // JOY_MESURE + // posX posY button - } if(idMsg == 0xF) { // JOY_ALIVE + // - - - - ALIVE_CHECKER_ISALIVE(ACjoy()); if(ACjoy()->state == STAC_DEAD){ - CAR_CST.JOYSTICK_MODE = MEM_read_one_byte(MEMADD_JOYSTICK_MODE); - CAR_CST.JOYSTICK_PARAM1 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM1); - CAR_CST.JOYSTICK_PARAM2 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM2); - CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_one_byte(MEMADD_JOYSTICK_ALIVE_TIME); + CAR_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE); + CAR_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1); + CAR_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2); + CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); ALIVE_CHECKER_emitBorn(ACjoy(), 0, 0); ALIVE_CHECKER_emitReady(ACjoy(), 100, 0); @@ -107,19 +120,70 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ } break; - case 3: // Display + + /*********** + * DISPLAY * + ***********/ + case 3: + if(idMsg == 0xF) { // DISPLAY_ALIVE + // powerMode - - - + + } break; - case 4: // Drive + + /********* + * DRIVE * + *********/ + case 4: + if(idMsg == 0x0) { // DRIVE_SPEED + // speedHH speedH speedL speedLL + + } + + if(idMsg == 0xF) { // DRIVE_ALIVE + // statusH statusL - - + + } break; - case 5: // Steering + + /************ + * STEERING * + ************/ + case 5: + if(idMsg == 0x1) { // STEERING_GET_CENTER + // valHH valH valL valLL + + } + + if(idMsg == 0x2) { // STEERING_GET_POSITION + // valHH valH valL valLL + + } + + if(idMsg == 0xF) { // STEERING_ALIVE + // statusH statusL - - + + } break; - case 6: // Supply + + /********** + * SUPPLY * + **********/ + case 6: + if(idMsg == 0xF) { // BATTERY_ALIVE + // - - - - + + } break; - case 7: // Undefined + + /************* + * UNDEFINED * + *************/ + case 7: break; } } diff --git a/306-controller_interface.X/app/car.h b/306-controller_interface.X/app/car.h index 5d3a9a8..d1ba7a7 100644 --- a/306-controller_interface.X/app/car.h +++ b/306-controller_interface.X/app/car.h @@ -34,12 +34,15 @@ #define MEMADD_JOYSTICK_PARAM1 0x12 #define MEMADD_JOYSTICK_PARAM2 0x13 #define MEMADD_JOYSTICK_ALIVE_TIME 0x14 -#define MEMADD_DISPLAY_ALIVE_TIME 0x -#define MEMADD_DRIVE_SPEED_TIME 0x -#define MEMADD_DRIVE_STOP_TIME 0x -#define MEMADD_DRIVE_ALIVE_TIME 0x -#define MEMADD_STEERING_ALIVE_TIME 0x -#define MEMADD_BATTERY_ALIVE_TIME 0x +#define MEMADD_DISPLAY_ALIVE_TIME 0x15 +#define MEMADD_DRIVE_SPEED_TIME 0x16 +#define MEMADD_DRIVE_STOP_TIME 0x17 +#define MEMADD_DRIVE_ALIVE_TIME 0x18 +#define MEMADD_STEERING_ALIVE_TIME 0x19 +#define MEMADD_BATTERY_VOLT_TIME 0x1A +#define MEMADD_BATTERY_CURRENT_TIME 0x1B +#define MEMADD_BATTERY_ENERGY_TIME 0x1C +#define MEMADD_BATTERY_ALIVE_TIME 0x1D typedef struct { uint8_t CONTROL_STEERING_MODE; @@ -49,7 +52,6 @@ typedef struct { uint32_t CONTROL_STEERING_FACTOR; uint8_t CONTROL_MAX_SPEED_FW; uint8_t CONTROL_MAX_SPEED_BW; - uint8_t JOYSTICK_MODE; uint8_t JOYSTICK_PARAM1; uint8_t JOYSTICK_PARAM2; @@ -59,6 +61,9 @@ typedef struct { uint8_t DRIVE_STOP_TIME; uint8_t DRIVE_ALIVE_TIME; uint8_t STEERING_ALIVE_TIME; + uint8_t BATTERY_VOLT_TIME; + uint8_t BATTERY_CURRENT_TIME; + uint8_t BATTERY_ENERGY_TIME; uint8_t BATTERY_ALIVE_TIME; } CAR_CST_TYPE; CAR_CST_TYPE CAR_CST; diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index b381255..11b5ec4 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -64,22 +64,12 @@ void Factory_init() { LED_off(l1()); // TODO init EPROM interface + MEM_init(); // TODO init watchdog with EPROM CST WATCHDOG_init(WDcontroller()); - MEM_write_one_byte(MEMADD_CONTROL_ALIVE_TIME, 10); - - CAR_CST.CONTROL_ALIVE_TIME = MEM_read_one_byte(MEMADD_CONTROL_ALIVE_TIME); WATCHDOG_setTime(WDcontroller(), CAR_CST.CONTROL_ALIVE_TIME); - MEM_write_one_byte(MEMADD_JOYSTICK_MODE, 0); - MEM_write_one_byte(MEMADD_JOYSTICK_PARAM1, 100); - MEM_write_one_byte(MEMADD_JOYSTICK_PARAM2, 1); - MEM_write_one_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME); - CAR_CST.JOYSTICK_MODE = MEM_read_one_byte(MEMADD_JOYSTICK_MODE); - CAR_CST.JOYSTICK_PARAM1 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM1); - CAR_CST.JOYSTICK_PARAM2 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM2); - CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_one_byte(MEMADD_JOYSTICK_ALIVE_TIME); ALIVE_CHECKER_init(ACjoy()); } diff --git a/306-controller_interface.X/middleware/eeprom_interface.c b/306-controller_interface.X/middleware/eeprom_interface.c index 7feb700..657329c 100644 --- a/306-controller_interface.X/middleware/eeprom_interface.c +++ b/306-controller_interface.X/middleware/eeprom_interface.c @@ -6,6 +6,7 @@ */ #include "eeprom_interface.h" +#include "../app/car.h" typedef union { struct { @@ -14,23 +15,121 @@ typedef union { uint8_t byte2; uint8_t byte3; } separate; - struct { - uint32_t bytes; - } full; + uint32_t full; + uint8_t array[4]; } BYTES_4; -void MEM_write_one_byte(uint8_t addresse, uint8_t data) { - DATAEE_WriteByte(addresse, data); +void MEM_init(){ + uint8_t check = MEM_read_1_byte(0x0); + if(check != 0x42){ + CAR_CST.CONTROL_STEERING_MODE = 0; + CAR_CST.CONTROL_ALIVE_TIME = 50; + CAR_CST.CONTROL_SPEED_FACTOR = 0; + CAR_CST.CONTROL_POWER_FACTOR = 0; + CAR_CST.CONTROL_STEERING_FACTOR = 0; + CAR_CST.CONTROL_MAX_SPEED_FW = 0; + CAR_CST.CONTROL_MAX_SPEED_BW = 0; + + CAR_CST.JOYSTICK_MODE = 0; + CAR_CST.JOYSTICK_PARAM1 = 100; + CAR_CST.JOYSTICK_PARAM2 = 1; + CAR_CST.JOYSTICK_ALIVE_TIME = 50; + + CAR_CST.DISPLAY_ALIVE_TIME = 0; + + CAR_CST.DRIVE_SPEED_TIME = 0; + CAR_CST.DRIVE_STOP_TIME = 0; + CAR_CST.DRIVE_ALIVE_TIME = 0; + + CAR_CST.STEERING_ALIVE_TIME = 0; + + CAR_CST.BATTERY_VOLT_TIME = 0; + CAR_CST.BATTERY_CURRENT_TIME = 0; + CAR_CST.BATTERY_ENERGY_TIME = 0; + CAR_CST.BATTERY_ALIVE_TIME = 0; + + MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); + MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME); + MEM_write_4_byte(MEMADD_CONTROL_SPEED_FACTOR, CAR_CST.CONTROL_SPEED_FACTOR); + MEM_write_4_byte(MEMADD_CONTROL_POWER_FACTOR, CAR_CST.CONTROL_POWER_FACTOR); + MEM_write_4_byte(MEMADD_CONTROL_STEERING_FACTOR, CAR_CST.CONTROL_STEERING_FACTOR); + MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_FW, CAR_CST.CONTROL_MAX_SPEED_FW); + MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_BW, CAR_CST.CONTROL_MAX_SPEED_BW); + + MEM_write_1_byte(MEMADD_JOYSTICK_MODE, CAR_CST.JOYSTICK_MODE); + MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, CAR_CST.JOYSTICK_PARAM1); + MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, CAR_CST.JOYSTICK_PARAM2); + MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.JOYSTICK_ALIVE_TIME); + + MEM_write_1_byte(MEMADD_DISPLAY_ALIVE_TIME, CAR_CST.DISPLAY_ALIVE_TIME); + + MEM_write_1_byte(MEMADD_DRIVE_SPEED_TIME, CAR_CST.DRIVE_SPEED_TIME); + MEM_write_1_byte(MEMADD_DRIVE_STOP_TIME, CAR_CST.DRIVE_STOP_TIME); + MEM_write_1_byte(MEMADD_DRIVE_ALIVE_TIME, CAR_CST.DRIVE_ALIVE_TIME); + + MEM_write_1_byte(MEMADD_STEERING_ALIVE_TIME, CAR_CST.STEERING_ALIVE_TIME); + + MEM_write_1_byte(MEMADD_BATTERY_VOLT_TIME, CAR_CST.BATTERY_VOLT_TIME); + MEM_write_1_byte(MEMADD_BATTERY_CURRENT_TIME, CAR_CST.BATTERY_CURRENT_TIME); + MEM_write_1_byte(MEMADD_BATTERY_ENERGY_TIME, CAR_CST.BATTERY_ENERGY_TIME); + MEM_write_1_byte(MEMADD_BATTERY_ALIVE_TIME, CAR_CST.BATTERY_ALIVE_TIME); + + MEM_write_1_byte(0x0, 0x42); + } else { + CAR_CST.CONTROL_STEERING_MODE = MEM_read_1_byte(MEMADD_CONTROL_STEERING_MODE); + CAR_CST.CONTROL_ALIVE_TIME = MEM_read_1_byte(MEMADD_CONTROL_ALIVE_TIME); + CAR_CST.CONTROL_SPEED_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_SPEED_FACTOR); + CAR_CST.CONTROL_POWER_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_POWER_FACTOR); + CAR_CST.CONTROL_STEERING_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_STEERING_FACTOR); + CAR_CST.CONTROL_MAX_SPEED_FW = MEM_read_1_byte(MEMADD_CONTROL_MAX_SPEED_FW); + CAR_CST.CONTROL_MAX_SPEED_BW = MEM_read_1_byte(MEMADD_CONTROL_MAX_SPEED_BW); + + CAR_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE); + CAR_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1); + CAR_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2); + CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); + + CAR_CST.DISPLAY_ALIVE_TIME = MEM_read_1_byte(MEMADD_DISPLAY_ALIVE_TIME); + + CAR_CST.DRIVE_SPEED_TIME = MEM_read_1_byte(MEMADD_DRIVE_SPEED_TIME); + CAR_CST.DRIVE_STOP_TIME = MEM_read_1_byte(MEMADD_DRIVE_STOP_TIME); + CAR_CST.DRIVE_ALIVE_TIME = MEM_read_1_byte(MEMADD_DRIVE_ALIVE_TIME); + + CAR_CST.STEERING_ALIVE_TIME = MEM_read_1_byte(MEMADD_STEERING_ALIVE_TIME); + + CAR_CST.BATTERY_VOLT_TIME = MEM_read_1_byte(MEMADD_BATTERY_VOLT_TIME); + CAR_CST.BATTERY_CURRENT_TIME = MEM_read_1_byte(MEMADD_BATTERY_CURRENT_TIME); + CAR_CST.BATTERY_ENERGY_TIME = MEM_read_1_byte(MEMADD_BATTERY_ENERGY_TIME); + CAR_CST.BATTERY_ALIVE_TIME = MEM_read_1_byte(MEMADD_BATTERY_ALIVE_TIME); + + } } -void MEM_write_four_byte(uint8_t addresse, uint32_t data) { +void MEM_write_1_byte(uint8_t address, uint8_t data) { + DATAEE_WriteByte(address, data); +} + +void MEM_write_4_byte(uint8_t address, uint32_t data) { + BYTES_4 tmpData; + tmpData.full = data; + for(uint8_t i = 0; i<4;i++) { + uint8_t add = address; + add += i; + MEM_write_1_byte(add, tmpData.array[i]); + } } -uint8_t MEM_read_one_byte(uint8_t adresse) { - return DATAEE_ReadByte(adresse); +uint8_t MEM_read_1_byte(uint8_t address) { + return DATAEE_ReadByte(address); } -uint32_t MEM_read_four_byte(uint8_t adresse) { - +uint32_t MEM_read_4_byte(uint8_t address) { + BYTES_4 tmpData; + for(uint8_t i = 0; i<4;i++) { + uint8_t add = address; + add += i; + tmpData.array[i] = MEM_read_1_byte(add); + } + return tmpData.full; } diff --git a/306-controller_interface.X/middleware/eeprom_interface.h b/306-controller_interface.X/middleware/eeprom_interface.h index d0f30a2..d4fff8e 100644 --- a/306-controller_interface.X/middleware/eeprom_interface.h +++ b/306-controller_interface.X/middleware/eeprom_interface.h @@ -11,10 +11,11 @@ #include // usage of boolean types #include "../mcc_generated_files/mcc.h" -void MEM_write_one_byte(uint8_t addresse, uint8_t data); -void MEM_write_four_byte(uint8_t adresse, uint32_t data); -uint8_t MEM_read_one_byte(uint8_t adresse); -uint32_t MEM_read_four_byte(uint8_t adresse); +void MEM_init(); +void MEM_write_1_byte(uint8_t address, uint8_t data); +void MEM_write_4_byte(uint8_t address, uint32_t data); +uint8_t MEM_read_1_byte(uint8_t address); +uint32_t MEM_read_4_byte(uint8_t address); // void MEM_write_CONTROL_STEERING_MODE(uint8_t data); #endif /* EEPROM_INTERFACE_H */ diff --git a/threewheeler.DBF b/threewheeler.DBF index 6f5fd33..727ded4 100644 --- a/threewheeler.DBF +++ b/threewheeler.DBF @@ -6,7 +6,7 @@ [BUSMASTER_VERSION] [3.2.2] -[NUMBER_OF_MESSAGES] 25 +[NUMBER_OF_MESSAGES] 26 [START_MSG] JOY_MEASURE,529,3,3,1,S [START_SIGNALS] posX,8,1,0,I,127,-128,1,0.000000,1.000000,%, @@ -150,4 +150,11 @@ [START_MSG] STEERING_GET_POS,1298,4,1,1,S [START_SIGNALS] POSITION,32,4,0,I,2147483647,-2147483648,0,0.000000,1.000000,qc, +[END_MSG] + +[START_MSG] CONTROL_SETUP_PARAM_JOY,22,4,4,1,S +[START_SIGNALS] mode,1,1,0,B,1,0,1,0.000000,1.000000,, +[START_SIGNALS] timeMeasureOrDeltaX,8,2,0,U,255,0,1,0.000000,10.000000,msOrVal, +[START_SIGNALS] DeltaY,8,3,0,U,255,0,1,0.000000,1.000000,val, +[START_SIGNALS] aliveTime,8,4,0,U,255,0,1,0.000000,10.000000,ms, [END_MSG] \ No newline at end of file From c0dda9d6d748721c82eb9cf48dd3b6a29015a159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 14:10:00 +0200 Subject: [PATCH 07/50] move eeprom --- 306-controller_interface.X/nbproject/configurations.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 858a8fd..6fdf382 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -28,7 +28,6 @@ middleware/can_interface.h middleware/alive_checker.h middleware/watchdog.h - middleware/eeprom_interface.h xf/event.h From 3c0f78d3b352b56bed21ef8ae39f56232e7b11ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 14:10:25 +0200 Subject: [PATCH 08/50] move eeprom file --- 306-controller_interface.X/nbproject/configurations.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 6fdf382..ce03b10 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -8,7 +8,6 @@ app/factory/factory.h app/car.h app/can_message.h - middleware/eeprom_interface.h board/led/led.h @@ -28,6 +27,7 @@ middleware/can_interface.h middleware/alive_checker.h middleware/watchdog.h + middleware/eeprom_interface.h xf/event.h From 66ebed131db33f1d2022898438ff81f4b6aaebca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 14:49:36 +0200 Subject: [PATCH 09/50] increase size of event in queue --- 306-controller_interface.X/xf/xf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/306-controller_interface.X/xf/xf.h b/306-controller_interface.X/xf/xf.h index 38c1f14..b74e185 100644 --- a/306-controller_interface.X/xf/xf.h +++ b/306-controller_interface.X/xf/xf.h @@ -28,7 +28,7 @@ typedef struct Timer_ // timer structure /* depending on usage, change MAXTIMER and MAXEVENT */ /*----------------------------------------------------------------------------*/ #define MAXTIMER 8 // number of timers in our system -#define MAXEVENT 12 // number of events in our system +#define MAXEVENT 20 // number of events in our system #define NULLTIMER 0 // no value for time #define TICKINTERVAL 10 // this is the ticktimers duration From 8dab08f7f8dff2a901da4db57feea66b830d6d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 16:26:59 +0200 Subject: [PATCH 10/50] refactor alive_checker --- UML/alive.uxf | 226 +++++++++++++++++++++++++++----------------------- 1 file changed, 123 insertions(+), 103 deletions(-) diff --git a/UML/alive.uxf b/UML/alive.uxf index 0f31457..b947a1e 100644 --- a/UML/alive.uxf +++ b/UML/alive.uxf @@ -1,13 +1,13 @@ - 14 + 15 UMLSpecialState - 266 - 98 - 28 - 28 + 735 + 45 + 30 + 30 type=initial @@ -15,115 +15,112 @@ Relation - 266 - 112 - 112 - 98 + 735 + 60 + 90 + 105 lt=-> -evACinit +evInit 10.0;10.0;10.0;50.0 UMLState - 210 - 182 - 140 - 56 + 615 + 135 + 285 + 90 - STAC_SETUP - - - - UMLNote - - 434 - 182 - 140 - 42 - - Send params - - - - Relation - - 266 - 224 - 126 - 98 - - lt=-> -evACborn - 10.0;10.0;10.0;50.0 - - - UMLState - - 210 - 294 - 140 - 56 - - STAC_BORN - - - - UMLState - - 168 - 406 - 224 - 84 - - STAC_WAIT + SETUP -- -/entry: isAlive = false +/entry: sendParamsOnCan Relation - 266 - 336 - 140 - 98 + 735 + 210 + 105 + 105 lt=-> -evACready +evBorn 10.0;10.0;10.0;50.0 UMLState - 210 - 658 - 140 - 56 + 615 + 285 + 285 + 90 - STAC_DEAD + BORN +-- +/entry: init + + + + UMLState + + 615 + 435 + 285 + 120 + + WAIT +-- +/entry: start children class +-- +isAlive = false Relation - 266 - 476 - 112 - 98 + 735 + 360 + 120 + 105 lt=-> -evACpoll +evReady + 10.0;10.0;10.0;50.0 + + + UMLState + + 615 + 735 + 285 + 90 + + DEAD +-- + + + + + Relation + + 735 + 540 + 105 + 105 + + lt=-> +evPoll 10.0;10.0;10.0;50.0 UMLSpecialState - 252 - 546 - 56 - 56 + 720 + 615 + 60 + 60 type=decision @@ -131,48 +128,71 @@ evACpoll Relation - 266 - 588 - 84 - 98 + 735 + 660 + 90 + 105 lt=-> m1=[else] 10.0;10.0;10.0;50.0 - UMLNote + Relation - 434 - 294 - 140 - 42 + 540 + 480 + 210 + 210 - Reset / Init - + lt=-> +m1=[isAlive] + 120.0;110.0;10.0;110.0;10.0;10.0;50.0;10.0 Relation - 294 - 420 - 182 - 196 + 885 + 150 + 210 + 405 lt=-> -m1=[alive] - 10.0;110.0;110.0;110.0;110.0;10.0;70.0;10.0 +evDisable + 10.0;250.0;60.0;250.0;60.0;10.0;10.0;10.0 Relation - 140 - 308 - 168 - 490 + 480 + 315 + 300 + 600 lt=-> -evACborn - 100.0;290.0;100.0;330.0;10.0;330.0;10.0;10.0;50.0;10.0 +evBorn + 180.0;340.0;180.0;380.0;10.0;380.0;10.0;10.0;90.0;10.0 + + + Relation + + 885 + 510 + 120 + 315 + + lt=- + 10.0;190.0;60.0;190.0;60.0;10.0 + + + Relation + + 885 + 330 + 120 + 45 + + lt=- + 10.0;10.0;60.0;10.0 From cd219510e27499996817fa18926867145313f295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 16:27:36 +0200 Subject: [PATCH 11/50] mini-polish eeprom --- .../middleware/eeprom_interface.h | 1 - .../nbproject/configurations.xml | 947 +++++++++++++++++- 2 files changed, 942 insertions(+), 6 deletions(-) diff --git a/306-controller_interface.X/middleware/eeprom_interface.h b/306-controller_interface.X/middleware/eeprom_interface.h index d4fff8e..62a0ee6 100644 --- a/306-controller_interface.X/middleware/eeprom_interface.h +++ b/306-controller_interface.X/middleware/eeprom_interface.h @@ -16,7 +16,6 @@ void MEM_write_1_byte(uint8_t address, uint8_t data); void MEM_write_4_byte(uint8_t address, uint32_t data); uint8_t MEM_read_1_byte(uint8_t address); uint32_t MEM_read_4_byte(uint8_t address); -// void MEM_write_CONTROL_STEERING_MODE(uint8_t data); #endif /* EEPROM_INTERFACE_H */ diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index ce03b10..224d919 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -238,7 +238,7 @@ - + @@ -250,6 +250,478 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -257,11 +729,15 @@ + + + + @@ -275,6 +751,24 @@ value="${memories.instruction.ram.ranges}"/> + + + + + + + + + + + + + + + + + + @@ -283,7 +777,7 @@ - + @@ -293,7 +787,453 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -301,15 +1241,12 @@ - - - From 7d8f91f554a33a6c75dfd0e3c158e0b393a95b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 17:36:03 +0200 Subject: [PATCH 12/50] start sequence diagram --- .gitignore | 1 + UML/can.puml | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .gitignore create mode 100644 UML/can.puml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3552451 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/UML/can.puml b/UML/can.puml new file mode 100644 index 0000000..fcb0a14 --- /dev/null +++ b/UML/can.puml @@ -0,0 +1,15 @@ +@startuml + +participant interrupt as ISR +participant ecan as ecan +queue XF as xf +participant can_interface as can + + +[-\\ ISR ++ : can message +ISR -> ecan : read +ecan --> ISR : message +ISR -> xf --: POST XF +xf o-> can : + +@enduml \ No newline at end of file From 233e1ff5adb155c7e6d8aae95c78b8a121007c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 17:36:18 +0200 Subject: [PATCH 13/50] change pic version --- .../mcc_generated_files/device_config.c | 2 +- .../mcc_generated_files/device_config.h | 2 +- .../mcc_generated_files/interrupt_manager.c | 2 +- .../mcc_generated_files/interrupt_manager.h | 2 +- .../mcc_generated_files/mcc.c | 2 +- .../mcc_generated_files/mcc.h | 2 +- .../mcc_generated_files/memory.c | 2 +- .../mcc_generated_files/memory.h | 8 +- .../mcc_generated_files/pin_manager.c | 2 +- .../mcc_generated_files/pin_manager.h | 2 +- .../mcc_generated_files/tmr0.c | 2 +- .../mcc_generated_files/tmr0.h | 2 +- .../nbproject/configurations.xml | 6 +- 306-controller_interface.X/ss22ep.mc3 | 90 +- 306-controller_interface.X/ss22ep.mc3.bak0 | 17224 ++++++++++++++++ 15 files changed, 17287 insertions(+), 63 deletions(-) create mode 100644 306-controller_interface.X/ss22ep.mc3.bak0 diff --git a/306-controller_interface.X/mcc_generated_files/device_config.c b/306-controller_interface.X/mcc_generated_files/device_config.c index eb96dd3..1e3bf51 100644 --- a/306-controller_interface.X/mcc_generated_files/device_config.c +++ b/306-controller_interface.X/mcc_generated_files/device_config.c @@ -14,7 +14,7 @@ This header file provides implementations for driver APIs for all modules selected in the GUI. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.00 The generated drivers are tested against the following: Compiler : XC8 2.36 and above or later diff --git a/306-controller_interface.X/mcc_generated_files/device_config.h b/306-controller_interface.X/mcc_generated_files/device_config.h index 0c48b82..72f9a53 100644 --- a/306-controller_interface.X/mcc_generated_files/device_config.h +++ b/306-controller_interface.X/mcc_generated_files/device_config.h @@ -14,7 +14,7 @@ This header file provides implementations for driver APIs for all modules selected in the GUI. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.00 The generated drivers are tested against the following: Compiler : XC8 2.36 and above or later diff --git a/306-controller_interface.X/mcc_generated_files/interrupt_manager.c b/306-controller_interface.X/mcc_generated_files/interrupt_manager.c index bd0b551..db7e86a 100644 --- a/306-controller_interface.X/mcc_generated_files/interrupt_manager.c +++ b/306-controller_interface.X/mcc_generated_files/interrupt_manager.c @@ -16,7 +16,7 @@ all modules selected in the GUI. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.04 The generated drivers are tested against the following: Compiler : XC8 2.36 and above or later diff --git a/306-controller_interface.X/mcc_generated_files/interrupt_manager.h b/306-controller_interface.X/mcc_generated_files/interrupt_manager.h index 90330f6..babb6f2 100644 --- a/306-controller_interface.X/mcc_generated_files/interrupt_manager.h +++ b/306-controller_interface.X/mcc_generated_files/interrupt_manager.h @@ -16,7 +16,7 @@ all modules selected in the GUI. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.03 The generated drivers are tested against the following: Compiler : XC8 2.36 and above or later diff --git a/306-controller_interface.X/mcc_generated_files/mcc.c b/306-controller_interface.X/mcc_generated_files/mcc.c index 0abd635..e2cbde5 100644 --- a/306-controller_interface.X/mcc_generated_files/mcc.c +++ b/306-controller_interface.X/mcc_generated_files/mcc.c @@ -14,7 +14,7 @@ This header file provides implementations for driver APIs for all modules selected in the GUI. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.00 The generated drivers are tested against the following: Compiler : XC8 2.36 and above or later diff --git a/306-controller_interface.X/mcc_generated_files/mcc.h b/306-controller_interface.X/mcc_generated_files/mcc.h index 6360c59..f681b38 100644 --- a/306-controller_interface.X/mcc_generated_files/mcc.h +++ b/306-controller_interface.X/mcc_generated_files/mcc.h @@ -14,7 +14,7 @@ This header file provides implementations for driver APIs for all modules selected in the GUI. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.00 The generated drivers are tested against the following: Compiler : XC8 2.36 and above or later diff --git a/306-controller_interface.X/mcc_generated_files/memory.c b/306-controller_interface.X/mcc_generated_files/memory.c index 3bf3c4c..b53aa2c 100644 --- a/306-controller_interface.X/mcc_generated_files/memory.c +++ b/306-controller_interface.X/mcc_generated_files/memory.c @@ -14,7 +14,7 @@ This file provides implementations of driver APIs for MEMORY. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.1.3 The generated drivers are tested against the following: Compiler : XC8 2.36 and above diff --git a/306-controller_interface.X/mcc_generated_files/memory.h b/306-controller_interface.X/mcc_generated_files/memory.h index e295cca..5020390 100644 --- a/306-controller_interface.X/mcc_generated_files/memory.h +++ b/306-controller_interface.X/mcc_generated_files/memory.h @@ -14,7 +14,7 @@ This header file provides APIs for driver for MEMORY. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.1.3 The generated drivers are tested against the following: Compiler : XC8 2.36 and above @@ -64,9 +64,9 @@ Section: Macro Declarations */ -#define WRITE_FLASH_BLOCKSIZE 64 -#define ERASE_FLASH_BLOCKSIZE 64 -#define END_FLASH 0x008000 +#define WRITE_FLASH_BLOCKSIZE 128 +#define ERASE_FLASH_BLOCKSIZE 128 +#define END_FLASH 0x010000 /** Section: Flash Module APIs diff --git a/306-controller_interface.X/mcc_generated_files/pin_manager.c b/306-controller_interface.X/mcc_generated_files/pin_manager.c index adf9b9a..b9c898e 100644 --- a/306-controller_interface.X/mcc_generated_files/pin_manager.c +++ b/306-controller_interface.X/mcc_generated_files/pin_manager.c @@ -14,7 +14,7 @@ This header file provides implementations for pin APIs for all pins selected in the GUI. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.11 The generated drivers are tested against the following: Compiler : XC8 2.36 and above diff --git a/306-controller_interface.X/mcc_generated_files/pin_manager.h b/306-controller_interface.X/mcc_generated_files/pin_manager.h index 791e977..a4d0d24 100644 --- a/306-controller_interface.X/mcc_generated_files/pin_manager.h +++ b/306-controller_interface.X/mcc_generated_files/pin_manager.h @@ -14,7 +14,7 @@ This header file provides APIs for driver for . Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 2.11 The generated drivers are tested against the following: Compiler : XC8 2.36 and above diff --git a/306-controller_interface.X/mcc_generated_files/tmr0.c b/306-controller_interface.X/mcc_generated_files/tmr0.c index 5e32ee5..72ae03d 100644 --- a/306-controller_interface.X/mcc_generated_files/tmr0.c +++ b/306-controller_interface.X/mcc_generated_files/tmr0.c @@ -14,7 +14,7 @@ This source file provides APIs for TMR0. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 3.10 The generated drivers are tested against the following: Compiler : XC8 2.36 and above diff --git a/306-controller_interface.X/mcc_generated_files/tmr0.h b/306-controller_interface.X/mcc_generated_files/tmr0.h index ad9154b..60b06d7 100644 --- a/306-controller_interface.X/mcc_generated_files/tmr0.h +++ b/306-controller_interface.X/mcc_generated_files/tmr0.h @@ -14,7 +14,7 @@ This header file provides APIs for TMR0. Generation Information : Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.81.8 - Device : PIC18F25K83 + Device : PIC18F26K83 Driver Version : 3.10 The generated drivers are tested against the following: Compiler : XC8 2.36 and above diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 224d919..fcd71c2 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -88,7 +88,7 @@ localhost - PIC18F25K83 + PIC18F26K83 PICkit3PlatformTool @@ -238,7 +238,7 @@ - + @@ -777,7 +777,7 @@ - + diff --git a/306-controller_interface.X/ss22ep.mc3 b/306-controller_interface.X/ss22ep.mc3 index 545a479..2f25ff4 100644 --- a/306-controller_interface.X/ss22ep.mc3 +++ b/306-controller_interface.X/ss22ep.mc3 @@ -1,4 +1,4 @@ - + @@ -17159,66 +17159,66 @@ Window delay time 87.5% - - - mcc_generated_files\interrupt_manager.h - 313560861c27e0a0b39b2bbb6a64ac2068fd1937dc0339d7303ff241bbb52955 - - - mcc_generated_files\mcc.h - aead6835bc73f4332d9abb5de6c2a40829de25cc98452c4c69960d51b52844e9 - - - mcc_generated_files\device_config.h - 2f04b3ff01bbe49769634d389433c7010ffb45d0f2973898e33988be7ab07d56 - - - mcc_generated_files\memory.c - ae2dbb373f8f03dd013cde153de046ba7c3c41033c1dedb8545cde41837ca3da - - - mcc_generated_files\tmr0.h - 68e2ba0f47166abd2da1a472d6a67bfde31f9be3edc8582ace93062a6a32f441 - + main.c - 91afd5df6694cfcd0279d66d9b5b3eb72a9c4eae825f0c0af82824e2ee66e35e + cae37ae3b36cf22e97e106633433f5c00a66dd5d38ec353eb67fbbb0d88bde4d mcc_generated_files\device_config.c - 4288704a051756dce8bb92e77a82ba1285fc638cde56b3676b59406ba0fcea7b + 39a6d1181ef5eab59c7dde2c52a9ea889465d4da43262200f3322abc45e77739 - mcc_generated_files\pin_manager.h - 3e61569926ed5f184a2267965f2cf7ca26dc997d552c213ebd94dbd80da54891 - - - mcc_generated_files\tmr0.c - f9702dc8c67433ffc3b8db9e12ee3a73fb0b152a792d26f6c7a89a3846bc4fc9 - - - mcc_generated_files\pin_manager.c - f8ace8a0b0d2a4f0ed3e209db056da57858e5a670ad7d514e44352d9187be806 + mcc_generated_files\device_config.h + 89c6172ff575ce515b93f2fbc85dcedc2978e58a8e0e1fbdc52e42511ae3bc05 mcc_generated_files\ecan.c - b60a119876875a2af386474d32176b8be0f47a074a2d8688e79251a2d7cdf6fa - - - mcc_generated_files\interrupt_manager.c - bb0eaf9aec0554de0106cff27f66e56ae02a40bbdcb68d4d58d8a0d84d8929f6 - - - mcc_generated_files\mcc.c - 34fadc3a271040b358215ec477acf3e135b77137f9a1cc96def75fc2936d3ad6 + ea62f50d319e1e537d7632774728ad6a779f442e896d043dbdea8066d028a6c6 mcc_generated_files\ecan.h - 0473fedf57d1376193e049ba507abed0960af84f0e416bea25972c4dae59ca26 + aa9a50aae81bab76b876ea6123777af7d6a6d0a58fe953be27e8b88776395b2e + + + mcc_generated_files\interrupt_manager.c + df04edcd2c7d85ef90a8dbe4e46f1b1c9487b872153f4f2321249a4ce0d9635f + + + mcc_generated_files\interrupt_manager.h + 9c2f1ae45f2ac887bb3e8b3763e1a394a6a22ffe4e9ae1c20c336fe6f12da1aa + + + mcc_generated_files\mcc.c + cc9ed44843b509879e6a3f676b561ecde91e1df88d855cf7eca77e1afc8920ca + + + mcc_generated_files\mcc.h + a2db7e36e878f686c2bf0c2ef586ef1c6570fa2f27119b4be7b52af6403091a4 + + + mcc_generated_files\memory.c + 17fb4759c4719b77287f6c4be48edfbcf117b5b8398b771c434f23aceac256e0 mcc_generated_files\memory.h - 77a34d015c961db9ed465b4ca2d85ba910fb030ca14c3c2854428ab0b9b6fac2 + fbbca4e9d7ce92ddcc637d82b694a1f5cbefa75710a8a18bb1dc9ab5161f0924 + + + mcc_generated_files\pin_manager.c + 04b16a3d3fcbbb333ee6fb545a405b76aba47ef3935be548bf2b8165c43c5654 + + + mcc_generated_files\pin_manager.h + 611a409602fd8fba29be052e06a3ce86ad0a3b723b5e0f4c1a998854de7f9a7b + + + mcc_generated_files\tmr0.c + e0b4d075e819024ae77ea60a2c01182fdca45b783980cb50358d0a614736339d + + + mcc_generated_files\tmr0.h + 6661ab783aae9f11e952805f9bca14209ec06551939552123056eefd5524fff8 \ No newline at end of file diff --git a/306-controller_interface.X/ss22ep.mc3.bak0 b/306-controller_interface.X/ss22ep.mc3.bak0 new file mode 100644 index 0000000..545a479 --- /dev/null +++ b/306-controller_interface.X/ss22ep.mc3.bak0 @@ -0,0 +1,17224 @@ + + + + + DMA CHANNEL1 + class com.microchip.mcc.mcu8.dmaManager.submodule.DMAModules + + + DMA CHANNEL2 + class com.microchip.mcc.mcu8.dmaManager.submodule.DMAModules + + + DMA Manager + class com.microchip.mcc.mcu8.dmaManager.DMA + + + ECAN + class com.microchip.mcc.mcu8.modules.can.CAN + + + INTERNAL OSCILLATOR + class com.microchip.mcc.mcu8.systemManager.osc.Osc + + + Interrupt Module + class com.microchip.mcc.mcu8.interruptManager_K42.InterruptManager + + + MEMORY + class com.microchip.mcc.mcu8.modules.memory.MEMORY + + + PMD + class com.microchip.mcc.mcu8.systemManager.pmd.PMD + + + Pin Module + class com.microchip.mcc.mcu8.pinManager.PinManager + + + RESET + class com.microchip.mcc.mcu8.systemManager.reset.RESET + + + System Module + class com.microchip.mcc.mcu8.systemManager.SystemManager + + + TMR0 + class com.microchip.mcc.mcu8.modules.tmr0_mid0.TMR0 + + + WWDT + class com.microchip.mcc.mcu8.systemManager.wwdt.WWDT + + + + + + + + + ISR_DMA CHANNEL1_DMAAI + + + + ISR_DMA CHANNEL1_DMADCNTI + + + + ISR_DMA CHANNEL1_DMAORI + + + + ISR_DMA CHANNEL1_DMASCNTI + + + + 10 + + + + 11 + + + + 45 + + + + 47 + + + + 40 + + + + 41 + + + + 42 + + + + 43 + + + + 44 + + + + 46 + + + + 35 + + + + 67 + + + + 74 + + + + 77 + + + + 38 + + + + 69 + + + + 76 + + + + 78 + + + + 12 + + + + 48 + + + + 6 + + + + 3 + + + + 37 + + + + 68 + + + + 75 + + + + 19 + + + + 17 + + + + 18 + + + + 16 + + + + 55 + + + + 53 + + + + 54 + + + + 52 + + + + 25 + + + + 26 + + + + 23 + + + + 24 + + + + 58 + + + + 59 + + + + 56 + + + + 57 + + + + 8 + + + + 39 + + + + 70 + + + + 7 + + + + 1 + + + + 36 + + + + 4 + + + + 0 + + + + 2 + + + + 5 + + + + 13 + + + + 14 + + + + 15 + + + + 49 + + + + 50 + + + + 51 + + + + 22 + + + + 20 + + + + 21 + + + + 31 + + + + 32 + + + + 33 + + + + 34 + + + + 64 + + + + 65 + + + + 66 + + + + 71 + + + + 72 + + + + 73 + + + + 30 + + + + 29 + + + + 27 + + + + 28 + + + + 63 + + + + 62 + + + + 60 + + + + 61 + + + + 9 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 2 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 2 + + + + 1 + + + + 0 + + + + 2 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 10 + + + + 11 + + + + 45 + + + + 47 + + + + 40 + + + + 41 + + + + 42 + + + + 43 + + + + 44 + + + + 46 + + + + 35 + + + + 67 + + + + 74 + + + + 77 + + + + 38 + + + + 69 + + + + 76 + + + + 78 + + + + 12 + + + + 48 + + + + 6 + + + + 3 + + + + 37 + + + + 68 + + + + 75 + + + + 19 + + + + 17 + + + + 18 + + + + 16 + + + + 55 + + + + 53 + + + + 54 + + + + 52 + + + + 25 + + + + 26 + + + + 23 + + + + 24 + + + + 58 + + + + 59 + + + + 56 + + + + 57 + + + + 8 + + + + 39 + + + + 70 + + + + 7 + + + + 1 + + + + 36 + + + + 4 + + + + 0 + + + + 2 + + + + 5 + + + + 13 + + + + 14 + + + + 15 + + + + 49 + + + + 50 + + + + 51 + + + + 22 + + + + 20 + + + + 21 + + + + 31 + + + + 32 + + + + 33 + + + + 34 + + + + 64 + + + + 65 + + + + 66 + + + + 71 + + + + 72 + + + + 73 + + + + 30 + + + + 29 + + + + 27 + + + + 28 + + + + 63 + + + + 62 + + + + 60 + + + + 61 + + + + 9 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + None + + + + disabled + + + + not in progress + + + + disabled + + + + disabled + + + + not in progress + + + + unchanged + + + + not cleared + + + + unchanged + + + + GPR + + + + not cleared + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + None + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + ISR_DMA CHANNEL2_DMAAI + + + + ISR_DMA CHANNEL2_DMADCNTI + + + + ISR_DMA CHANNEL2_DMAORI + + + + ISR_DMA CHANNEL2_DMASCNTI + + + + 10 + + + + 11 + + + + 45 + + + + 47 + + + + 40 + + + + 41 + + + + 42 + + + + 43 + + + + 44 + + + + 46 + + + + 35 + + + + 67 + + + + 74 + + + + 77 + + + + 38 + + + + 69 + + + + 76 + + + + 78 + + + + 12 + + + + 48 + + + + 6 + + + + 3 + + + + 37 + + + + 68 + + + + 75 + + + + 19 + + + + 17 + + + + 18 + + + + 16 + + + + 55 + + + + 53 + + + + 54 + + + + 52 + + + + 25 + + + + 26 + + + + 23 + + + + 24 + + + + 58 + + + + 59 + + + + 56 + + + + 57 + + + + 8 + + + + 39 + + + + 70 + + + + 7 + + + + 1 + + + + 36 + + + + 4 + + + + 0 + + + + 2 + + + + 5 + + + + 13 + + + + 14 + + + + 15 + + + + 49 + + + + 50 + + + + 51 + + + + 22 + + + + 20 + + + + 21 + + + + 31 + + + + 32 + + + + 33 + + + + 34 + + + + 64 + + + + 65 + + + + 66 + + + + 71 + + + + 72 + + + + 73 + + + + 30 + + + + 29 + + + + 27 + + + + 28 + + + + 63 + + + + 62 + + + + 60 + + + + 61 + + + + 9 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 2 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 2 + + + + 1 + + + + 0 + + + + 2 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 10 + + + + 11 + + + + 45 + + + + 47 + + + + 40 + + + + 41 + + + + 42 + + + + 43 + + + + 44 + + + + 46 + + + + 35 + + + + 67 + + + + 74 + + + + 77 + + + + 38 + + + + 69 + + + + 76 + + + + 78 + + + + 12 + + + + 48 + + + + 6 + + + + 3 + + + + 37 + + + + 68 + + + + 75 + + + + 19 + + + + 17 + + + + 18 + + + + 16 + + + + 55 + + + + 53 + + + + 54 + + + + 52 + + + + 25 + + + + 26 + + + + 23 + + + + 24 + + + + 58 + + + + 59 + + + + 56 + + + + 57 + + + + 8 + + + + 39 + + + + 70 + + + + 7 + + + + 1 + + + + 36 + + + + 4 + + + + 0 + + + + 2 + + + + 5 + + + + 13 + + + + 14 + + + + 15 + + + + 49 + + + + 50 + + + + 51 + + + + 22 + + + + 20 + + + + 21 + + + + 31 + + + + 32 + + + + 33 + + + + 34 + + + + 64 + + + + 65 + + + + 66 + + + + 71 + + + + 72 + + + + 73 + + + + 30 + + + + 29 + + + + 27 + + + + 28 + + + + 63 + + + + 62 + + + + 60 + + + + 61 + + + + 9 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + None + + + + disabled + + + + not in progress + + + + disabled + + + + disabled + + + + not in progress + + + + unchanged + + + + not cleared + + + + unchanged + + + + GPR + + + + not cleared + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + None + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + {"dataArray":[{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL1","value":"false"},"id":"DMA Channels_rowCount_0"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_0"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_0"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_0"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName0","value":"SrcVarName0"},"id":"Src VarName_rowCount_0"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_0","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"},"id":"Src Address_rowCount_0","Src Address":{"isDisable":"true","options":"","text":"Enter Address0","value":"Enter Address0"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_0"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_0"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_0"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_0"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_0"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName0","value":"DstVarName0"},"id":"Dst VarName_rowCount_0"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_0","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_0"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_0"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Start Trigger_rowCount_0"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Abort Trigger_rowCount_0","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}},{"DMA Channels":{"data":{"isDisable":"true","options":"--NONE--","text":"DMA CHANNEL2","value":"false"},"id":"DMA Channels_rowCount_1"},"Src Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Src Module_rowCount_1"},"Src Region":{"data":{"isDisable":"true","options":"SFR#disabled,GPR#enabled,Program Flash#enabled,Data EEPROM#enabled","text":"GPR","value":"GPR"},"id":"Src Region_rowCount_1"},"Src SFR":{"Src SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Src SFR_rowCount_1"},"Src VarName":{"data":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"Src VarName":{"isDisable":"true","options":"","text":"SrcVarName1","value":"SrcVarName1"},"id":"Src VarName_rowCount_1"},"Src VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Src VarSize_rowCount_1","Src VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Src Address":{"data":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"},"id":"Src Address_rowCount_1","Src Address":{"isDisable":"true","options":"","text":"Enter Address1","value":"Enter Address1"}},"Src Mode":{"Src Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Src Mode_rowCount_1"},"Src Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Src Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Src Message Size_rowCount_1"},"Dst Module":{"data":{"isDisable":"true","options":"--NONE--,MEMORY,ECAN,TMR0","text":"--NONE--","value":"--NONE--"},"id":"Dst Module_rowCount_1"},"Dst Region":{"data":{"isDisable":"true","options":"SFR,GPR","text":"GPR","value":"GPR"},"id":"Dst Region_rowCount_1"},"Dst SFR":{"Dst SFR":{"isDisable":"true","options":"","text":"","value":""},"data":{"isDisable":"true","options":"","text":"","value":""},"id":"Dst SFR_rowCount_1"},"Dst VarName":{"data":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"Dst VarName":{"isDisable":"true","options":"","text":"DstVarName1","value":"DstVarName1"},"id":"Dst VarName_rowCount_1"},"Dst VarSize":{"data":{"isDisable":"true","options":"","text":"10","value":"10"},"id":"Dst VarSize_rowCount_1","Dst VarSize":{"isDisable":"true","options":"","text":"10","value":"10"}},"Dst Mode":{"data":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"Dst Mode":{"isDisable":"true","options":"decremented,incremented,unchanged","text":"unchanged","value":"unchanged"},"id":"Dst Mode_rowCount_1"},"Dst Message Size":{"data":{"isDisable":"true","options":"","text":"1","value":"1"},"Dst Message Size":{"isDisable":"true","options":"","text":"1","value":"1"},"id":"Dst Message Size_rowCount_1"},"Start Trigger":{"Start Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Start Trigger_rowCount_1"},"Abort Trigger":{"data":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"},"id":"Abort Trigger_rowCount_1","Abort Trigger":{"isDisable":"true","options":"AD,ADT,CAN_ERRIF,CAN_IRXIF,CAN_RXB0IF\/FIFOIF,CAN_RXB1IF\/RXBnIF,CAN_TXB0IF,CAN_TXB1IF,CAN_TXB2IF\/TXBnIF,CAN_WAKIF,CCP1,CCP2,CCP3,CCP4,CLC1,CLC2,CLC3,CLC4,CMP1,CMP2,CRC,CSW,CWG1,CWG2,CWG3,DMA1A,DMA1DCNT,DMA1OR,DMA1SCNT,DMA2A,DMA2DCNT,DMA2OR,DMA2SCNT,I2C1,I2C1E,I2C1RX,I2C1TX,I2C2,I2C2E,I2C2RX,I2C2TX,INT0,INT1,INT2,IOC,LVD,NCO,NVM,None,OSF,SCAN,SMT1,SMT1PRA,SMT1PWA,SMT2,SMT2PRA,SMT2PWA,SPI1,SPI1RX,SPI1TX,TMR0,TMR1,TMR1G,TMR2,TMR3,TMR3G,TMR4,TMR5,TMR5G,TMR6,U1,U1E,U1RX,U1TX,U2,U2E,U2RX,U2TX,ZCD","text":"None","value":"None"}}}],"type":"tableDynamicControls","key":"dmaTable"} + + + + ERRI_ISR + + + + FIFOWMI_ISR + + + + IRXI_ISR + + + + RXB0I_ISR + + + + RXB1I_ISR + + + + RXBnI_ISR + + + + TXB0I_ISR + + + + TXB1I_ISR + + + + TXB2I_ISR + + + + TXBnI_ISR + + + + WAKI_ISR + + + + Filter 0 + + + + SID + + + + Acceptance Mask 0 + + + + FIFO + + + + 250kbps + + + + 64000000 + + + + PIC18F26K83 + + + + CANTX pin will drive VDD when recessive + + + + 1000000 + + + + 8 + + + + FIFO Watermark interrupt is disabled + + + + 0 + + + + hfintosc + + + + 1 x TQ + + + + 75% + + + + 8 + + + + 64000000 + + + + 64000000 + + + + 0 + + + + enabled + + + + enabled + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 9 + + + + 10 + + + + 11 + + + + 12 + + + + 13 + + + + 14 + + + + 15 + + + + 16 + + + + 17 + + + + 18 + + + + 1 + + + + 19 + + + + 20 + + + + 21 + + + + 22 + + + + 23 + + + + 24 + + + + 25 + + + + 26 + + + + 27 + + + + 28 + + + + 2 + + + + 29 + + + + 30 + + + + 31 + + + + 32 + + + + 33 + + + + 34 + + + + 35 + + + + 36 + + + + 37 + + + + 38 + + + + 3 + + + + 39 + + + + 40 + + + + 41 + + + + 42 + + + + 43 + + + + 44 + + + + 45 + + + + 46 + + + + 47 + + + + 48 + + + + 4 + + + + 49 + + + + 50 + + + + 51 + + + + 52 + + + + 53 + + + + 54 + + + + 55 + + + + 56 + + + + 57 + + + + 58 + + + + 5 + + + + 59 + + + + 60 + + + + 61 + + + + 14 + + + + 63 + + + + 6 + + + + 7 + + + + 8 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 4 + + + + 3 + + + + 2 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 8 + + + + 9 + + + + 1 + + + + 6 + + + + 7 + + + + 2 + + + + 15 + + + + 16 + + + + 17 + + + + 18 + + + + 19 + + + + 20 + + + + 21 + + + + 22 + + + + 23 + + + + 3 + + + + 4 + + + + 5 + + + + 0 + + + + 1 + + + + 2 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 15 + + + + 152 + + + + 129 + + + + 0 + + + + 128 + + + + 0 + + + + 0 + + + + 144 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + When a remote transmission request is received, TXREQ will be unaffected + + + + Receive buffer is open to receive a new message + + + + Receive all valid messages as per acceptance filters + + + + Received message is not a remote transmission request + + + + Message was not aborted + + + + No message was transmitted + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + 0 + + + + 0 + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + This is not a remote transmission request + + + + Transmitted message will have the RTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Received message is a standard identifier frame + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + When a remote transmission request is received, TXREQ will be unaffected + + + + Receive buffer is open to receive a new message + + + + Receive all valid messages as per acceptance filters + + + + Received message is not a remote transmission request + + + + Message was not aborted + + + + No message was transmitted + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + 0 + + + + 0 + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + This is not a remote transmission request + + + + Transmitted message will have the RTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Received message is a standard identifier frame + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + When a remote transmission request is received, TXREQ will be unaffected + + + + Receive buffer is open to receive a new message + + + + Receive all valid messages as per acceptance filters + + + + Received message is not a remote transmission request + + + + Message was not aborted + + + + No message was transmitted + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + 0 + + + + 0 + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + This is not a remote transmission request + + + + Transmitted message will have the RTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Received message is a standard identifier frame + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + When a remote transmission request is received, TXREQ will be unaffected + + + + Receive buffer is open to receive a new message + + + + Receive all valid messages as per acceptance filters + + + + Received message is not a remote transmission request + + + + Message was not aborted + + + + No message was transmitted + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + 0 + + + + 0 + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + This is not a remote transmission request + + + + Transmitted message will have the RTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Received message is a standard identifier frame + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + When a remote transmission request is received, TXREQ will be unaffected + + + + Receive buffer is open to receive a new message + + + + Receive all valid messages as per acceptance filters + + + + Received message is not a remote transmission request + + + + Message was not aborted + + + + No message was transmitted + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + 0 + + + + 0 + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + This is not a remote transmission request + + + + Transmitted message will have the RTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Received message is a standard identifier frame + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + When a remote transmission request is received, TXREQ will be unaffected + + + + Receive buffer is open to receive a new message + + + + Receive all valid messages as per acceptance filters + + + + Received message is not a remote transmission request + + + + Message was not aborted + + + + No message was transmitted + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + 0 + + + + 0 + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + This is not a remote transmission request + + + + Transmitted message will have the RTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Received message is a standard identifier frame + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Interrupt is disabled + + + + Interrupt is disabled + + + + Interrupt is disabled + + + + Interrupt is disabled + + + + Interrupt is disabled + + + + Interrupt is disabled + + + + Interrupt is disabled + + + + Interrupt is disabled + + + + TQ = (2 x 16)/FOSC + + + + Synchronization jump width time = 1 x TQ + + + + 1 x TQ + + + + Bus line is sampled once at the sample point + + + + 4 x TQ + + + + Freely programmable + + + + 2 x TQ + + + + Disable CAN bus activity wake-up feature + + + + CAN bus line filter is not used for wake-up + + + + Buffer 0 is configured in Receive mode + + + + Buffer 1 is configured in Receive mode + + + + Buffer 2 is configured in Receive mode + + + + Buffer 3 is configured in Receive mode + + + + Buffer 4 is configured in Receive mode + + + + Buffer 5 is configured in Receive mode + + + + Transmissions proceeding as normal + + + + 0 + + + + Requests Configuration Mode + + + + 0 + + + + 0 + + + + 0 + + + + Use system clock as CAN system clock + + + + CANTX1 pin will output CANTX + + + + Neither the RXWARN or the TXWARN bits are set + + + + Receive Buffer 0 has not overflowed + + + + Receive Buffer 1 has not overflowed + + + + Receive error counter LESS OR EQUAL THAN 127 + + + + Receive Buffer n has not overflowed + + + + Receive error counter LESS OR EQUAL THAN 95 + + + + Transmit error counter LESS OR EQUAL THAN 255 + + + + Transmit error counter LESS OR EQUAL THAN 127 + + + + Transmit error counter LESS OR EQUAL THAN 95 + + + + Receive Buffer 0 + + + + FIF0 Interrupt when four receive buffer remains + + + + Enhanced FIFO mode( Mode 2) + + + + enabled + + + + disabled + + + + -1 + + + + 1 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Mask 0 + + + + Acceptance Filter 0 (RXF0) + + + + 0 + + + + Allows jump table offset between 1 and 0 + + + + No Receive Buffer 0 overflow to Receive Buffer 1 + + + + Receive buffer is open to receive a new message + + + + A remote transmission request is not received + + + + Receive all valid messages as per acceptance filters + + + + A remote transmission request is not received + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Receive buffer is open to receive a new message + + + + A remote transmission request is not received + + + + Receive all valid messages as per acceptance filters + + + + A remote transmission request is not received + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + enabled + + + + disabled + + + + -1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Filter will only accept standard ID messages + + + + 0 + + + + 0 + + + + 0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + RXB0 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Both standard and extended identifier messages will be accepted + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Both standard and extended identifier messages will be accepted + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Message was not aborted + + + + Transmit buffer has not completed transmission of a message + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + Priority Level 0 (lowest priority) + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + Transmitted message will have the TXRTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Message will transmit standard ID + + + + 0 + + + + 0 + + + + 0 + + + + Message was not aborted + + + + Transmit buffer has not completed transmission of a message + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + Priority Level 0 (lowest priority) + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + Transmitted message will have the TXRTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Message will transmit standard ID + + + + 0 + + + + 0 + + + + 0 + + + + Message was not aborted + + + + Transmit buffer has not completed transmission of a message + + + + A bus error did not occur while the message was being sent + + + + Message did not lose arbitration while being sent + + + + Priority Level 0 (lowest priority) + + + + Automatically cleared when the message is successfully sent + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Data length = 0 bytes + + + + Transmitted message will have the TXRTR bit cleared + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + Message will transmit standard ID + + + + 0 + + + + 0 + + + + 0 + + + + Transmit buffer interrupt is disabled + + + + Transmit buffer interrupt is disabled + + + + Transmit buffer interrupt is disabled + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + + + + + 64000000 + + + + Oscillator not enabled + + + + HFINTOSC with HFFRQ = 64 MHz and CDIV = 1:1 + + + + 64_MHz + + + + 1000000 + + + + 64000000 + + + + 64000000 + + + + 31000 + + + + 31250 + + + + 500000 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + internal + + + + OFF + + + + PRESENT + + + + disabled + + + + disabled + + + + 0 + + + + 7 + + + + 4 + + + + 1 + + + + 8 + + + + 5 + + + + 2 + + + + 9 + + + + 6 + + + + 3 + + + + 7 + + + + 2 + + + + 6 + + + + 5 + + + + 4 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 4 + + + + 5 + + + + 0 + + + + 1 + + + + 6 + + + + 7 + + + + 2 + + + + 8 + + + + 3 + + + + 96 + + + + 0 + + + + 0 + + + + 8 + + + + 0 + + + + 1 + + + + HFINTOSC + + + + may proceed + + + + not ready + + + + clock switching + + + + Low power + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 64_MHz + + + + 0 + + + + 8 + + + + IVT1 + + + + disabled + + + + disabled + + + + enabled + + + + enabled + + + + 65536 + + + + 128 + + + + ISR + + + + 128 + + + + enabled + + + + 1 + + + + 0 + + + + 2 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + write + + + + access_data_eeprom + + + + do_not_initiate_read + + + + write_complete + + + + disabled + + + + normal_completion + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + -1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + CLKR enabled + + + + CRC enabled + + + + FVR enabled + + + + HLVD enabled + + + + IOC enabled + + + + NVM enabled + + + + SCANNER enabled + + + + SYSCLK enabled + + + + DDS(NCO1) enabled + + + + TMR0 enabled + + + + TMR1 enabled + + + + TMR2 enabled + + + + TMR3 enabled + + + + TMR4 enabled + + + + TMR5 enabled + + + + TMR6 enabled + + + + ADC enabled + + + + CMP1 enabled + + + + CMP2 enabled + + + + DAC enabled + + + + ZCD enabled + + + + CCP1 enabled + + + + CCP2 enabled + + + + CCP3 enabled + + + + CCP4 enabled + + + + PWM5 enabled + + + + PWM6 enabled + + + + PWM7 enabled + + + + PWM8 enabled + + + + CWG1 enabled + + + + CWG2 enabled + + + + CWG3 enabled + + + + I2C1 enabled + + + + I2C2 enabled + + + + SPI1 enabled + + + + UART1 enabled + + + + UART2 enabled + + + + CLC1 enabled + + + + CLC2 enabled + + + + CLC3 enabled + + + + CLC4 enabled + + + + DSM1 enabled + + + + SMT1 enabled + + + + SMT2 enabled + + + + DMA1 enabled + + + + DMA2 enabled + + + + OUTPUT1 + + + + OUTPUT2 + + + + OUTPUT3 + + + + OUTPUT4 + + + + OUTPUT5 + + + + OUTPUT6 + + + + OUTPUT7 + + + + OUTPUT8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ISR_Pin Module_IOCI + + + + output + + + + output + + + + output + + + + output + + + + output + + + + output + + + + output + + + + output + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + %DESELECT% + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + enabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + none + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + SOIC28 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + enabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 12 + + + + 0 + + + + 238 + + + + 255 + + + + 12 + + + + 18 + + + + 17 + + + + 13 + + + + 8 + + + + 0 + + + + 1 + + + + 14 + + + + 15 + + + + 8 + + + + 9 + + + + 10 + + + + 19 + + + + 20 + + + + 9 + + + + 2 + + + + 255 + + + + 255 + + + + 255 + + + + 8 + + + + 8 + + + + 9 + + + + 10 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 4 + + + + 3 + + + + 5 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 51 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 255 + + + + 255 + + + + 255 + + + + 17 + + + + 16 + + + + 13 + + + + 12 + + + + 19 + + + + 20 + + + + 5 + + + + 4 + + + + 16 + + + + 13 + + + + 19 + + + + 16 + + + + 16 + + + + 21 + + + + 18 + + + + 12 + + + + 15 + + + + 0 + + + + 246 + + + + 255 + + + + 22 + + + + 23 + + + + 14 + + + + 15 + + + + 128 + + + + 0 + + + + 0 + + + + 0 + + + + 12 + + + + digital + + + + digital + + + + digital + + + + digital + + + + digital + + + + digital + + + + digital + + + + digital + + + + digital + + + + analog + + + + analog + + + + analog + + + + digital + + + + analog + + + + analog + + + + analog + + + + analog + + + + analog + + + + analog + + + + analog + + + + analog + + + + analog + + + + analog + + + + analog + + + + 12 + + + + 18 + + + + 17 + + + + 13 + + + + 8 + + + + 0 + + + + 1 + + + + 14 + + + + 15 + + + + 8 + + + + 9 + + + + 10 + + + + 19 + + + + 20 + + + + 9 + + + + 2 + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + ST_input + + + + 8 + + + + 9 + + + + 10 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + 1 + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + 4 + + + + 3 + + + + 5 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 51 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + limited + + + + 17 + + + + 16 + + + + 13 + + + + 12 + + + + 19 + + + + 20 + + + + 5 + + + + 4 + + + + 16 + + + + 13 + + + + 19 + + + + 16 + + + + 16 + + + + 21 + + + + 18 + + + + 12 + + + + 15 + + + + output + + + + output + + + + output + + + + output + + + + output + + + + output + + + + output + + + + output + + + + output + + + + input + + + + input + + + + output + + + + input + + + + input + + + + input + + + + input + + + + input + + + + input + + + + input + + + + input + + + + input + + + + input + + + + input + + + + input + + + + 22 + + + + 23 + + + + 14 + + + + 15 + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + set + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + clear + + + + 31.0 KHz + + + + enabled + + + + 1 + + + + 0 + + + + 0 + + + + 8 + + + + 0 + + + + 32 + + + + 0 + + + + 2 + + + + 7 + + + + 5 + + + + 6 + + + + 2 + + + + 0 + + + + 4 + + + + 3 + + + + 1 + + + + 112 + + + + 32 + + + + 96 + + + + 0 + + + + 80 + + + + 16 + + + + 64 + + + + 3 + + + + 1 + + + + 0 + + + + 32 + + + + 0 + + + + 0 + + + + 8 + + + + 0 + + + + 16 + + + + 128 + + + + 0 + + + + 4 + + + + 0 + + + + 128 + + + + 0 + + + + 64 + + + + 192 + + + + 0 + + + + 16 + + + + 32 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + 8 + + + + 0 + + + + 2 + + + + 4 + + + + 6 + + + + 0 + + + + 8 + + + + 56 + + + + 16 + + + + 0 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 0 + + + + 1 + + + + 10 + + + + 11 + + + + 12 + + + + 13 + + + + 14 + + + + 15 + + + + 16 + + + + 17 + + + + 18 + + + + 2 + + + + 3 + + + + 31 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 9 + + + + 64 + + + + 0 + + + + 96 + + + + 32 + + + + 0 + + + + 32 + + + + 1 + + + + 0 + + + + 2 + + + + 0 + + + + 4 + + + + 0 + + + + 8 + + + + 0 + + + + 8 + + + + 0 + + + + 6 + + + + 5 + + + + 4 + + + + 7 + + + + 3 + + + + 16 + + + + 0 + + + + 128 + + + + 0 + + + + 1 + + + + 0 + + + + 43 + + + + 4 + + + + 191 + + + + 247 + + + + 63 + + + + 31 + + + + 47 + + + + 159 + + + + 1 + + + + OFF + + + + ON + + + + ON + + + + ON + + + + OFF + + + + HFINTOSC_64MHZ + + + + VBOR_2P45 + + + + OFF + + + + ON + + + + ON + + + + OFF + + + + OFF + + + + SBORDIS + + + + ON + + + + OFF + + + + EXTMCLR + + + + OFF + + + + PWRT_OFF + + + + SC + + + + WDTCWS_7 + + + + WDTCPS_31 + + + + OFF + + + + ON + + + + OFF + + + + OFF + + + + OFF + + + + OFF + + + + OFF + + + + BBSIZE_512 + + + + OFF + + + + OFF + + + + OFF + + + + 0 + + + + ISR + + + + 0.01 + + + + 64000000 + + + + 100000 + + + + periodMode + + + + 0.01024 + + + + 0.00004 + + + + 10 + + + + 64 + + + + 25000 + + + + 0.01 + + + + disabled + + + + 0 + + + + enabled + + + + 8-bit + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 9 + + + + 10 + + + + 11 + + + + 12 + + + + 13 + + + + 14 + + + + 15 + + + + 1 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 7 + + + + 8 + + + + 1 + + + + 0 + + + + 0 + + + + 10 + + + + 7 + + + + 4 + + + + 14 + + + + 1 + + + + 11 + + + + 8 + + + + 5 + + + + 15 + + + + 2 + + + + 12 + + + + 9 + + + + 6 + + + + 3 + + + + 13 + + + + 7 + + + + 2 + + + + 3 + + + + 4 + + + + 5 + + + + 6 + + + + 0 + + + + 1 + + + + 137 + + + + 70 + + + + 249 + + + + 0 + + + + 8-bit + + + + enabled + + + + low + + + + 1:10 + + + + synchronised + + + + 1:64 + + + + FOSC/4 + + + + 249 + + + + 0 + + + + enabled + + + + disabled + + + + -1 + + + + 1 + + + + 2.11406 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 5 + + + + 15 + + + + 2 + + + + 12 + + + + 9 + + + + 6 + + + + 16 + + + + 3 + + + + 13 + + + + 0 + + + + 10 + + + + 7 + + + + 17 + + + + 4 + + + + 14 + + + + 1 + + + + 11 + + + + 8 + + + + 18 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 2 + + + + 7 + + + + 6 + + + + 5 + + + + 4 + + + + 3 + + + + 2 + + + + 1 + + + + 0 + + + + 48 + + + + 0 + + + + 0 + + + + WDT reset has not occurred + + + + WDT window violation reset has not occurred + + + + 1:32 + + + + OFF + + + + LFINTOSC 31kHz + + + + Window delay time 87.5% + + + + + mcc_generated_files\interrupt_manager.h + 313560861c27e0a0b39b2bbb6a64ac2068fd1937dc0339d7303ff241bbb52955 + + + mcc_generated_files\mcc.h + aead6835bc73f4332d9abb5de6c2a40829de25cc98452c4c69960d51b52844e9 + + + mcc_generated_files\device_config.h + 2f04b3ff01bbe49769634d389433c7010ffb45d0f2973898e33988be7ab07d56 + + + mcc_generated_files\memory.c + ae2dbb373f8f03dd013cde153de046ba7c3c41033c1dedb8545cde41837ca3da + + + mcc_generated_files\tmr0.h + 68e2ba0f47166abd2da1a472d6a67bfde31f9be3edc8582ace93062a6a32f441 + + + main.c + 91afd5df6694cfcd0279d66d9b5b3eb72a9c4eae825f0c0af82824e2ee66e35e + + + mcc_generated_files\device_config.c + 4288704a051756dce8bb92e77a82ba1285fc638cde56b3676b59406ba0fcea7b + + + mcc_generated_files\pin_manager.h + 3e61569926ed5f184a2267965f2cf7ca26dc997d552c213ebd94dbd80da54891 + + + mcc_generated_files\tmr0.c + f9702dc8c67433ffc3b8db9e12ee3a73fb0b152a792d26f6c7a89a3846bc4fc9 + + + mcc_generated_files\pin_manager.c + f8ace8a0b0d2a4f0ed3e209db056da57858e5a670ad7d514e44352d9187be806 + + + mcc_generated_files\ecan.c + b60a119876875a2af386474d32176b8be0f47a074a2d8688e79251a2d7cdf6fa + + + mcc_generated_files\interrupt_manager.c + bb0eaf9aec0554de0106cff27f66e56ae02a40bbdcb68d4d58d8a0d84d8929f6 + + + mcc_generated_files\mcc.c + 34fadc3a271040b358215ec477acf3e135b77137f9a1cc96def75fc2936d3ad6 + + + mcc_generated_files\ecan.h + 0473fedf57d1376193e049ba507abed0960af84f0e416bea25972c4dae59ca26 + + + mcc_generated_files\memory.h + 77a34d015c961db9ed465b4ca2d85ba910fb030ca14c3c2854428ab0b9b6fac2 + + + \ No newline at end of file From a360586503bd41360fb94f78a8246083472b624e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 17:36:30 +0200 Subject: [PATCH 14/50] fix alive uml --- UML/alive.uxf | 64 +++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/UML/alive.uxf b/UML/alive.uxf index b947a1e..e54aa37 100644 --- a/UML/alive.uxf +++ b/UML/alive.uxf @@ -4,8 +4,8 @@ UMLSpecialState - 735 - 45 + 510 + 30 30 30 @@ -15,8 +15,8 @@ Relation - 735 - 60 + 510 + 45 90 105 @@ -27,8 +27,8 @@ evInit UMLState - 615 - 135 + 390 + 120 285 90 @@ -40,8 +40,8 @@ evInit Relation - 735 - 210 + 510 + 195 105 105 @@ -52,8 +52,8 @@ evBorn UMLState - 615 - 285 + 390 + 270 285 90 @@ -65,8 +65,8 @@ evBorn UMLState - 615 - 435 + 390 + 420 285 120 @@ -80,8 +80,8 @@ isAlive = false Relation - 735 - 360 + 510 + 345 120 105 @@ -92,8 +92,8 @@ evReady UMLState - 615 - 735 + 390 + 720 285 90 @@ -105,8 +105,8 @@ evReady Relation - 735 - 540 + 510 + 525 105 105 @@ -117,8 +117,8 @@ evPoll UMLSpecialState - 720 - 615 + 495 + 600 60 60 @@ -128,8 +128,8 @@ evPoll Relation - 735 - 660 + 510 + 645 90 105 @@ -140,8 +140,8 @@ m1=[else] Relation - 540 - 480 + 315 + 465 210 210 @@ -152,8 +152,8 @@ m1=[isAlive] Relation - 885 - 150 + 660 + 135 210 405 @@ -164,8 +164,8 @@ evDisable Relation - 480 - 315 + 255 + 300 300 600 @@ -176,8 +176,8 @@ evBorn Relation - 885 - 510 + 660 + 495 120 315 @@ -187,8 +187,8 @@ evBorn Relation - 885 - 330 + 660 + 315 120 45 From 792625bab121139f4ea7107a5bb938fb132d4b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 18:23:11 +0200 Subject: [PATCH 15/50] move eeprom --- .../app/factory/factory.h | 2 +- .../{eeprom_interface.c => eeprom.c} | 18 +++++++++--------- .../{eeprom_interface.h => eeprom.h} | 0 .../nbproject/configurations.xml | 7 ++++--- 4 files changed, 14 insertions(+), 13 deletions(-) rename 306-controller_interface.X/middleware/{eeprom_interface.c => eeprom.c} (92%) rename 306-controller_interface.X/middleware/{eeprom_interface.h => eeprom.h} (100%) diff --git a/306-controller_interface.X/app/factory/factory.h b/306-controller_interface.X/app/factory/factory.h index 7b21e07..b847d38 100644 --- a/306-controller_interface.X/app/factory/factory.h +++ b/306-controller_interface.X/app/factory/factory.h @@ -19,7 +19,7 @@ #include "../../middleware/alive_checker.h" #include "../../middleware/can_interface.h" #include "../../middleware/watchdog.h" -#include "../../middleware/eeprom_interface.h" +#include "../../middleware/eeprom.h" typedef struct { diff --git a/306-controller_interface.X/middleware/eeprom_interface.c b/306-controller_interface.X/middleware/eeprom.c similarity index 92% rename from 306-controller_interface.X/middleware/eeprom_interface.c rename to 306-controller_interface.X/middleware/eeprom.c index 657329c..48c8a58 100644 --- a/306-controller_interface.X/middleware/eeprom_interface.c +++ b/306-controller_interface.X/middleware/eeprom.c @@ -5,7 +5,7 @@ * @file eeprom_interface.h */ -#include "eeprom_interface.h" +#include "eeprom.h" #include "../app/car.h" typedef union { @@ -33,20 +33,20 @@ void MEM_init(){ CAR_CST.JOYSTICK_MODE = 0; CAR_CST.JOYSTICK_PARAM1 = 100; CAR_CST.JOYSTICK_PARAM2 = 1; - CAR_CST.JOYSTICK_ALIVE_TIME = 50; + CAR_CST.JOYSTICK_ALIVE_TIME = 10; - CAR_CST.DISPLAY_ALIVE_TIME = 0; + CAR_CST.DISPLAY_ALIVE_TIME = 50; CAR_CST.DRIVE_SPEED_TIME = 0; CAR_CST.DRIVE_STOP_TIME = 0; - CAR_CST.DRIVE_ALIVE_TIME = 0; + CAR_CST.DRIVE_ALIVE_TIME = 10; - CAR_CST.STEERING_ALIVE_TIME = 0; + CAR_CST.STEERING_ALIVE_TIME = 100; - CAR_CST.BATTERY_VOLT_TIME = 0; - CAR_CST.BATTERY_CURRENT_TIME = 0; - CAR_CST.BATTERY_ENERGY_TIME = 0; - CAR_CST.BATTERY_ALIVE_TIME = 0; + CAR_CST.BATTERY_VOLT_TIME = 50; + CAR_CST.BATTERY_CURRENT_TIME = 50; + CAR_CST.BATTERY_ENERGY_TIME = 50; + CAR_CST.BATTERY_ALIVE_TIME = 50; MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME); diff --git a/306-controller_interface.X/middleware/eeprom_interface.h b/306-controller_interface.X/middleware/eeprom.h similarity index 100% rename from 306-controller_interface.X/middleware/eeprom_interface.h rename to 306-controller_interface.X/middleware/eeprom.h diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index fcd71c2..8a70ed6 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -27,7 +27,7 @@ middleware/can_interface.h middleware/alive_checker.h middleware/watchdog.h - middleware/eeprom_interface.h + middleware/eeprom.h xf/event.h @@ -64,7 +64,7 @@ middleware/can_interface.c middleware/alive_checker.c middleware/watchdog.c - middleware/eeprom_interface.c + middleware/eeprom.c xf/event.c @@ -94,7 +94,7 @@ PICkit3PlatformTool XC8 2.41 - 3 + 2 @@ -216,6 +216,7 @@ + From 3de64a329cd22bff94e902d579be27af650b6074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 21:17:18 +0200 Subject: [PATCH 16/50] add alive.pdf --- UML/alive.pdf | Bin 0 -> 2639 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 UML/alive.pdf diff --git a/UML/alive.pdf b/UML/alive.pdf new file mode 100644 index 0000000000000000000000000000000000000000..75b99e57b0615e294c094164e6f3c290aa07eb5b GIT binary patch literal 2639 zcmai0d0Z3M7Pha5{!&H64N-6qF`z(ZvXBHJ$_@gGK_dYogk%yEF_C0K0RaWn!UIvU zLGJGWm5r-aY04Y&d|JKEx-5fKXdN+&Y5%0ch6m{13kR# zAqO(fx~u!fO&lEn0coTd=j=@Ihb2N}BLI=;M1q$n3V~$=uP818d%!#?A7(J*hz#a# z#>M9U791d*M>Vd~o_Sc|f&|EDEpW2MVCPh3;cniEW_7b`PH%_W%hk@x^JAir7Uu9| zWyQVOtW5?L_Xq7R-v4QC_InjQm-374;Ne`3BfhFn@lw@xyecHIF#Oc6D~g+h1pkEHK{>R68TP1`oVdLEv{@X+pvYJ2wZ za?Kj;ZL;&H+Qg=5cFW5{&K*1X3 z6h8S`)^*kH=n;#JuI?TU-`j3~TODMmOHLoCWSkB@IYINax_*;-DX;u#UD4%vo8GC` zWL&v6qiFGpyI=9 z6`j3yd*+b?3ggW$8_)Vbx%&DW_Qk!gH`T5=HzQ@z%*_2MYPaclG6wQ~e-Tr|%;45H#brhaBd4=_czi;N_ei(AYiB=TR%@#kW*wrmJtH3AO=QaXE;;0#KL#RWu zr)IA;!@q0jC_DIT*GF^RHmDo#aw`;fhEx$8kG899ON4euW9YT*J`?SisTNIs$am4b z-XU!M1Y2kFt>cF0rb)YA3cX7)Xp1E4fjhf^KKXx_|FN`F- z(#3?Y+h3acvsM?E+h)A)UPAGCqKVe)5c?wAuhb>J?be10x>?zf+1<{pp@voYcPLI% z1{>&_v(UjVr6>MM<9prp_>b?)&$JjFGX5r~J*DfY3+!BcdP2F%{}3ao$d^8dPqo!; z)7|M5x~pDXwH22I`7_@=-uI~R+ch<9h@ou6{@Bx-?2s1r@WS7S51#4LA|gHEHF?1l ztIBS5;fg%5c=%PwEc0$;;SGbUTAPl+Oz!LAZtn2Oz70rUt544PV9nWtf=2do6X6G+ z{B|qO#22CIRlz3SIrTuRn`hXt!RkiqCP|~Ng;%z<-mJ`j`3KsRtvyB_NL`_8pfV)6 zI>V^{@M#nCTScjMPO+JfCuA&1w`f`tSDhc8bjK=gRrAXfL)Sx<|Jsbdv971)-_Gmz zKO)9GgL-N{b<|sEm(|?jIw%f4S@KIvSNTGtrCsHVjY!dNO}om0RwVuWfq9JT%ugQ; zkl!myaIl20KYCFKJF6jR?9g5tw*@8ya)mG<0OpIhZqnFL5Jkz3AmB&@IRqvwmnvjD zSdJd>UQ!8yeIS5>nlKp*f@dt^9fY7~JgW8%f&lEtOjIHQM7=};NP3A3ko6J;aMVkV z097wh0U9PT&_QrVO`4q%rH6U|PB&HxC@3pK#%!K%P=(BC|xMPS(xf)tSmRuQIw z2yR?CJgWAAqher0#N!e?CFo@&k_ZXwMG{wuT=d`h*ndAGhsOoLF#t5x^jm5x77y~{Fj?aOTY@|K4nR=Z18p1|4<{l>B!M&{4WdJ2B4sH^#DgH-mJlH2 z|4)OlYGP%u00#mP8HeVeAAlo;LZScyK(B+Sj_AT-1CacsqhZ8+p`(wZqmAS1NJUBc z!k0=zd*llpjWmw#pLQS!p$+|oFMS+eGIbm~8oE>d?n?we_eEq}Q4}o0UTHz1co?OM zz?4eS{`hm7`bq>+^xcNG7?a@Z0fah7LXi-eB7g;4vH&7Q5 Date: Mon, 28 Aug 2023 21:17:42 +0200 Subject: [PATCH 17/50] Update configurations.xml --- 306-controller_interface.X/nbproject/configurations.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 8a70ed6..3dc5c26 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -8,6 +8,7 @@ app/factory/factory.h app/car.h app/can_message.h + middleware/eeprom.h board/led/led.h @@ -27,7 +28,6 @@ middleware/can_interface.h middleware/alive_checker.h middleware/watchdog.h - middleware/eeprom.h xf/event.h @@ -45,6 +45,7 @@ app/factory/factory.c app/can_message.c + middleware/eeprom.c board/led/led.c @@ -64,7 +65,6 @@ middleware/can_interface.c middleware/alive_checker.c middleware/watchdog.c - middleware/eeprom.c xf/event.c From fbd207c02e69ae912459fd79ed4b91296c1aa93f Mon Sep 17 00:00:00 2001 From: Klagarge Date: Mon, 28 Aug 2023 21:27:11 +0200 Subject: [PATCH 18/50] update can sequence --- UML/can.puml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/UML/can.puml b/UML/can.puml index fcb0a14..b574624 100644 --- a/UML/can.puml +++ b/UML/can.puml @@ -1,15 +1,29 @@ @startuml +actor CAN_BUS as bus participant interrupt as ISR -participant ecan as ecan queue XF as xf +participant ecan as ecan participant can_interface as can +control can_message as msg -[-\\ ISR ++ : can message -ISR -> ecan : read -ecan --> ISR : message -ISR -> xf --: POST XF -xf o-> can : +bus -\\ ISR ++ : can message +ISR -> can : newMsg +can -> ecan : read +ecan --> can : message +can -> xf : POST XF +destroy ISR + group clock xf [every 10ms] +xf o-> can : receiveCan +can -> msg : processIncome +msg -> can : create message +can -> xf : POST XF + end + group clock xf [every 10ms] +xf o-> can : sendCan +can -> ecan : write +ecan -\\ bus : can message + end @enduml \ No newline at end of file From ef36b21ad4fa112bc7534595c5cdc64fddd60f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 21:17:18 +0200 Subject: [PATCH 19/50] add alive.pdf --- UML/alive.pdf | Bin 0 -> 2639 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 UML/alive.pdf diff --git a/UML/alive.pdf b/UML/alive.pdf new file mode 100644 index 0000000000000000000000000000000000000000..75b99e57b0615e294c094164e6f3c290aa07eb5b GIT binary patch literal 2639 zcmai0d0Z3M7Pha5{!&H64N-6qF`z(ZvXBHJ$_@gGK_dYogk%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gL-N{b<|sEm(|?jIw%f4S@KIvSNTGtrCsHVjY!dNO}om0RwVuWfq9JT%ugQ; zkl!myaIl20KYCFKJF6jR?9g5tw*@8ya)mG<0OpIhZqnFL5Jkz3AmB&@IRqvwmnvjD zSdJd>UQ!8yeIS5>nlKp*f@dt^9fY7~JgW8%f&lEtOjIHQM7=};NP3A3ko6J;aMVkV z097wh0U9PT&_QrVO`4q%rH6U|PB&HxC@3pK#%!K%P=(BC|xMPS(xf)tSmRuQIw z2yR?CJgWAAqher0#N!e?CFo@&k_ZXwMG{wuT=d`h*ndAGhsOoLF#t5x^jm5x77y~{Fj?aOTY@|K4nR=Z18p1|4<{l>B!M&{4WdJ2B4sH^#DgH-mJlH2 z|4)OlYGP%u00#mP8HeVeAAlo;LZScyK(B+Sj_AT-1CacsqhZ8+p`(wZqmAS1NJUBc z!k0=zd*llpjWmw#pLQS!p$+|oFMS+eGIbm~8oE>d?n?we_eEq}Q4}o0UTHz1co?OM zz?4eS{`hm7`bq>+^xcNG7?a@Z0fah7LXi-eB7g;4vH&7Q5 Date: Mon, 28 Aug 2023 21:17:42 +0200 Subject: [PATCH 20/50] Update configurations.xml --- 306-controller_interface.X/nbproject/configurations.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 8a70ed6..3dc5c26 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -8,6 +8,7 @@ app/factory/factory.h app/car.h app/can_message.h + middleware/eeprom.h board/led/led.h @@ -27,7 +28,6 @@ middleware/can_interface.h middleware/alive_checker.h middleware/watchdog.h - middleware/eeprom.h xf/event.h @@ -45,6 +45,7 @@ app/factory/factory.c app/can_message.c + middleware/eeprom.c board/led/led.c @@ -64,7 +65,6 @@ middleware/can_interface.c middleware/alive_checker.c middleware/watchdog.c - middleware/eeprom.c xf/event.c From 59edb49d5cdd128478c1ae09a23939f370ecb45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 29 Aug 2023 08:31:52 +0200 Subject: [PATCH 21/50] fix filters comments --- .../mcc_generated_files/ecan.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/306-controller_interface.X/mcc_generated_files/ecan.c b/306-controller_interface.X/mcc_generated_files/ecan.c index 8b2c89b..e1bfd4d 100644 --- a/306-controller_interface.X/mcc_generated_files/ecan.c +++ b/306-controller_interface.X/mcc_generated_files/ecan.c @@ -130,17 +130,21 @@ void ECAN_Initialize(void) /* * ENABLE FILTERS * - * Filter 0 set on mask 0 - * Filter 1 set on mask 0 - * Filter 2 set on mask 1 + * RXF7EN RXF6EN RXF5EN RXF4EN RXF3EN RXF2EN RXF1EN RXF0EN + * 0b 00000111 */ RXFCON0 = 0x07; - /** - Assign Filters to Masks - */ - // Filter 0 & 1 assigned to mask 0 and filter 2 assigned to mask 1 + /* + * Assign Filters to Masks + * + * Filter 0 set on mask 0 + * Filter 1 set on mask 0 + * Filter 2 set on mask 1 + * 0b F3 F2 F1 F0 + * 0b 00 01 00 00 + */ MSEL0 = 0x10; /** From 6bc73fa166744e91af4bdc92a2f181c3a86c9642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 29 Aug 2023 14:11:48 +0200 Subject: [PATCH 22/50] merge alive_checker and watchdog to alive class --- 306-controller_interface.X/app/can_message.c | 14 +- .../app/factory/factory.c | 34 ++- .../app/factory/factory.h | 11 +- 306-controller_interface.X/middleware/alive.c | 259 ++++++++++++++++ 306-controller_interface.X/middleware/alive.h | 178 +++++++++++ .../middleware/alive_checker.c | 176 ----------- .../middleware/alive_checker.h | 134 -------- .../middleware/watchdog.c | 90 ------ .../middleware/watchdog.h | 83 ----- .../nbproject/configurations.xml | 8 +- UML/alive.pdf | Bin 2639 -> 3736 bytes UML/alive.uxf | 287 +++++++++++------- 12 files changed, 650 insertions(+), 624 deletions(-) create mode 100644 306-controller_interface.X/middleware/alive.c create mode 100644 306-controller_interface.X/middleware/alive.h delete mode 100644 306-controller_interface.X/middleware/alive_checker.c delete mode 100644 306-controller_interface.X/middleware/alive_checker.h delete mode 100644 306-controller_interface.X/middleware/watchdog.c delete mode 100644 306-controller_interface.X/middleware/watchdog.h diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 05f929a..2e5cca0 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -37,7 +37,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ CAR_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3; MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME); - WATCHDOG_setTime(WDcontroller(), CAR_CST.CONTROL_ALIVE_TIME); + ALIVE_setAliveTime(ALcontroller(), CAR_CST.CONTROL_ALIVE_TIME); } if(idMsg == 0x1) { // CONTROL_SPEED_FACTOR @@ -78,7 +78,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, CAR_CST.JOYSTICK_PARAM2); MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.JOYSTICK_ALIVE_TIME); - ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); + ALIVE_setAliveTime(ALjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); CM_JOY_SETUP(NULL); } @@ -107,15 +107,15 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0xF) { // JOY_ALIVE // - - - - - ALIVE_CHECKER_ISALIVE(ACjoy()); - if(ACjoy()->state == STAC_DEAD){ + ALIVE_ISALIVE(ALjoy()); + if(ALjoy()->state == STAL_DEAD){ CAR_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE); CAR_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1); CAR_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2); CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); - ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); - ALIVE_CHECKER_emitBorn(ACjoy(), 0, 0); - ALIVE_CHECKER_emitReady(ACjoy(), 100, 0); + ALIVE_setAliveTime(ALjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); + ALIVE_emitBorn(ALjoy(), 0, 0); + ALIVE_emitReady(ALjoy(), 100, 0); } } break; diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index 11b5ec4..fe819c8 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -30,12 +30,12 @@ LED* l8() { return &theFactory.l8_; } -WATCHDOG* WDcontroller(){ - return &theFactory.WDcontroller_; +ALIVE* ALcontroller(){ + return &theFactory.ALcontroller_; } -ALIVE_CHECKER* ACjoy() { - return &theFactory.ACjoy_; +ALIVE* ALjoy(){ + return &theFactory.ALjoy_; } @@ -67,10 +67,10 @@ void Factory_init() { MEM_init(); // TODO init watchdog with EPROM CST - WATCHDOG_init(WDcontroller()); - WATCHDOG_setTime(WDcontroller(), CAR_CST.CONTROL_ALIVE_TIME); + ALIVE_init(ALcontroller()); + ALIVE_setAliveTime(ALcontroller(), CAR_CST.CONTROL_ALIVE_TIME); - ALIVE_CHECKER_init(ACjoy()); + ALIVE_init(ALjoy()); } //connect objects if required @@ -78,20 +78,22 @@ void Factory_build() { ECAN_SetRXBnInterruptHandler(CAN_newMsg); CAN_onReceiveCan(CM_processIncome); - WATCHDOG_onAlive(WDcontroller(), CM_CONTROLLER_ALIVE, NULL); - ALIVE_CHECKER_onSetup(ACjoy(), CM_JOY_SETUP, NULL); - ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); - ALIVE_CHECKER_onBorn(ACjoy(), LED_on, l1()); - ALIVE_CHECKER_onDead(ACjoy(), LED_off, l1()); + ALIVE_onAlive(ALcontroller(), CM_CONTROLLER_ALIVE, NULL); + + ALIVE_onSetup(ALjoy(), CM_JOY_SETUP, NULL); + ALIVE_setAliveTime(ALjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); + ALIVE_onBorn(ALjoy(), LED_on, l1()); + ALIVE_onDead(ALjoy(), LED_off, l1()); } //start all state machines void Factory_start() { CAN_startBehaviour(); - WATCHDOG_startBehaviour(WDcontroller()); - ALIVE_CHECKER_startBehaviour(ACjoy()); - ALIVE_CHECKER_emitBorn(ACjoy(), 100, 0); - ALIVE_CHECKER_emitReady(ACjoy(), 200, 0); + + ALIVE_startBehaviourSender(ALcontroller()); + ALIVE_startBehaviourChecker(ALjoy()); + ALIVE_emitBorn(ALjoy(), 100, 0); + ALIVE_emitReady(ALjoy(), 200, 0); } diff --git a/306-controller_interface.X/app/factory/factory.h b/306-controller_interface.X/app/factory/factory.h index b847d38..bcbc830 100644 --- a/306-controller_interface.X/app/factory/factory.h +++ b/306-controller_interface.X/app/factory/factory.h @@ -16,9 +16,8 @@ #include "../can_message.h" #include "../../board/led/led.h" #include "../../board/button/button.h" -#include "../../middleware/alive_checker.h" +#include "../../middleware/alive.h" #include "../../middleware/can_interface.h" -#include "../../middleware/watchdog.h" #include "../../middleware/eeprom.h" @@ -32,8 +31,8 @@ typedef struct { LED l7_; LED l8_; - WATCHDOG WDcontroller_; - ALIVE_CHECKER ACjoy_; + ALIVE ALcontroller_; + ALIVE ALjoy_; } Factory; @@ -52,8 +51,8 @@ LED* l6(); LED* l7(); LED* l8(); -WATCHDOG* WDcontroller(); -ALIVE_CHECKER* ACjoy(); +ALIVE* ALcontroller(); +ALIVE* ALjoy(); #endif \ No newline at end of file diff --git a/306-controller_interface.X/middleware/alive.c b/306-controller_interface.X/middleware/alive.c new file mode 100644 index 0000000..146e9f3 --- /dev/null +++ b/306-controller_interface.X/middleware/alive.c @@ -0,0 +1,259 @@ +/** + * @author Rémi Heredero + * @version 1.0.0 + * @date August 2023 + * @file alive.c + */ + +#include "alive.h" + +void ALIVE_init(ALIVE* me){ + me->state = STAL_INIT; + me->isAlive = false; + me->checker = false; + me->sender = false; + me->haveBreak = true; + me->aliveTime = 10; + me->setup.f = NULL; + me->born.f = NULL; + me->wait.f = NULL; + me->dead.f = NULL; + me->alive.f = NULL; + me->break_cb.f = NULL; +} + +void ALIVE_startBehaviourChecker(ALIVE* me){ + POST(me, &ALIVE_processEvent, evALinitChecker, 0, 0); +} + +void ALIVE_startBehaviourSender(ALIVE* me){ + POST(me, &ALIVE_processEvent, evALinitSender, 0, 0); +} + +bool ALIVE_processEvent(Event* ev) { + bool processed = false; + ALIVE* me = (ALIVE*)Event_getTarget(ev); + ALIVE_STATES oldState = me->state; + evIDT evid = Event_getId(ev); + uint64_t data = Event_getData(ev); + + switch (me->state) { // onState + case STAL_INIT: + if (ev->id == evALinitChecker) { + me->state = STAL_SETUP; + } + if (ev->id == evALinitSender) { + me->state = STAL_ALIVE; + ALIVE_emitPoll(me, me->aliveTime*10, 0); + } + break; + + case STAL_SETUP: + if (ev->id == evALborn) { + me->state = STAL_BORN; + } + break; + + case STAL_BORN: + if (ev->id == evALready) { + me->state = STAL_WAIT; + ALIVE_emitPoll(me, me->aliveTime*10, 0); + } + break; + + case STAL_WAIT: + if (ev->id == evALpoll) { + + if (me->aliveTime == 0) { + if (me->haveBreak){ + me->state = STAL_BREAK; + } + } else if (me->isAlive){ + me->state = STAL_WAIT; + ALIVE_emitPoll(me, me->aliveTime*10, 0); + } else { + me->state = STAL_DEAD; + } + me->isAlive = false; + + } + break; + + case STAL_DEAD: + if (ev->id == evALborn) { + me->state = STAL_BORN; + } + break; + + case STAL_ALIVE: + if (ev->id == evALpoll) { + if (me->alive.f != NULL) { + me->alive.f(me->alive.p); + } + if (me->aliveTime == 0) { + if (me->haveBreak){ + me->state == STAL_BREAK; + } + } else { + ALIVE_emitPoll(me, me->aliveTime*10, 0); + } + } + break; + + case STAL_BREAK: + if (ev->id == evALstart) { + ALIVE_emitPoll(me, me->aliveTime*10, 0); + if (me->checker) { + me->state = STAL_WAIT; + } + if (me->sender) { + me->state = STAL_ALIVE; + } + } + break; + } + + if(oldState != me->state){ + switch (oldState) { // onExit + case STAL_INIT: + break; + + case STAL_SETUP: + break; + + case STAL_BORN: + break; + + case STAL_WAIT: + break; + + case STAL_DEAD: + break; + + case STAL_ALIVE: + break; + + case STAL_BREAK: + break; + } + + switch (me->state) { // onEntry + case STAL_INIT: + break; + + case STAL_SETUP: + if (me->setup.f != NULL) { + me->setup.f(me->setup.p); + } + break; + + case STAL_BORN: + if (me->born.f != NULL) { + me->born.f(me->born.p); + } + break; + + case STAL_WAIT: + if (me->wait.f != NULL) { + me->wait.f(me->wait.p); + } + break; + + case STAL_DEAD: + if (me->dead.f != NULL) { + me->dead.f(me->dead.p); + } + break; + + case STAL_ALIVE: + break; + + case STAL_BREAK: + if (me->break_cb.f != NULL) { + me->break_cb.f(me->break_cb.p); + } + break; + } + + processed = true; + } + return processed; +} + +/************* + * Callbacks * + *************/ + +void ALIVE_onSetup(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p) { + me->setup.f = f; + me->setup.p = p; +} + +void ALIVE_onBorn(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p) { + me->born.f = f; + me->born.p = p; +} + +void ALIVE_onWait(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p) { + me->wait.f = f; + me->wait.p = p; +} + +void ALIVE_onDead(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p) { + me->dead.f = f; + me->dead.p = p; +} + +void ALIVE_onAlive(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p) { + me->alive.f = f; + me->alive.p = p; +} + +void ALIVE_onBreak(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p) { + me->break_cb.f = f; + me->break_cb.p = p; +} + +/************ + * EMITTERS * + ************/ + +void ALIVE_emitInitSender(ALIVE* me, uint16_t t, int64_t data) { + POST(me, &ALIVE_processEvent, evALinitSender, t, data); +} + +void ALIVE_emitBorn(ALIVE* me, uint16_t t, int64_t data) { + POST(me, &ALIVE_processEvent, evALborn, t, data); +} + +void ALIVE_emitReady(ALIVE* me, uint16_t t, int64_t data) { + POST(me, &ALIVE_processEvent, evALready, t, data); +} + +void ALIVE_emitPoll(ALIVE* me, uint16_t t, int64_t data) { + POST(me, &ALIVE_processEvent, evALpoll, t, data); +} + +void ALIVE_emitStart(ALIVE* me, uint16_t t, int64_t data) { + POST(me, &ALIVE_processEvent, evALstart, t, data); +} + +/*********** + * SETTERS * + ***********/ + +void ALIVE_setIsAlive(ALIVE* me, bool v) { + me->isAlive = v; +} + +void ALIVE_setHaveBreak(ALIVE* me, bool v) { + me->haveBreak = v; +} + +void ALIVE_setAliveTime(ALIVE* me, uint8_t v) { + me->aliveTime = v; +} + +void ALIVE_ISALIVE(ALIVE* me) { + ALIVE_setIsAlive(me, true); +} diff --git a/306-controller_interface.X/middleware/alive.h b/306-controller_interface.X/middleware/alive.h new file mode 100644 index 0000000..749d9a9 --- /dev/null +++ b/306-controller_interface.X/middleware/alive.h @@ -0,0 +1,178 @@ +/** + * @author Rémi Heredero + * @version 1.0.0 + * @date August 2023 + * @file alive.h + */ +#ifndef ALIVE_H +#define ALIVE_H + +#include "../xf/xf.h" + +typedef enum { + STAL_INIT, + STAL_SETUP, + STAL_BORN, + STAL_WAIT, + STAL_DEAD, + STAL_ALIVE, + STAL_BREAK +} ALIVE_STATES; + +typedef enum { + evALinitChecker = 15, + evALinitSender, + evALborn, + evALready, + evALpoll, + evALstart +} ALIVE_EVENTS; + +typedef void (*ALIVE_CALLBACK_FUNCTION)(void*); +typedef struct { + ALIVE_CALLBACK_FUNCTION f; // function + void* p; // param(s) +} ALIVE_CALLBACK; + +typedef struct { + ALIVE_STATES state; + bool isAlive; + bool checker; + bool sender; + bool haveBreak; + uint8_t aliveTime; + ALIVE_CALLBACK setup; + ALIVE_CALLBACK born; + ALIVE_CALLBACK wait; + ALIVE_CALLBACK dead; + ALIVE_CALLBACK alive; + ALIVE_CALLBACK break_cb; +} ALIVE; + +/** + * Initialize the ALIVE + * @param me the ALIVE itself + */ +void ALIVE_init(ALIVE* me); + +/** + * Start the ALIVE state machine for checker part + * @param me the ALIVE itself + */ +void ALIVE_startBehaviourChecker(ALIVE* me); + +/** + * Start the ALIVE state machine for sender part + * @param me the ALIVE itself + */ +void ALIVE_startBehaviourSender(ALIVE* me); + +/** + * Process the event + * @param ev the event to process + * @return true if the event is processed + */ +bool ALIVE_processEvent(Event* ev); + +/************* + * Callbacks * + *************/ + +/** + * Set the callback function to call when the ALIVE is entering state setup + * @param me the ALIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void ALIVE_onSetup(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the ALIVE is entering state born + * @param me the ALIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void ALIVE_onBorn(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the ALIVE is entering state wait + * @param me the ALIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void ALIVE_onWait(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the ALIVE is entering state dead + * @param me the ALIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void ALIVE_onDead(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the ALIVE is entering state alive + * @param me the ALIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void ALIVE_onAlive(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the ALIVE is entering state break + * @param me the ALIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void ALIVE_onBreak(ALIVE* me, ALIVE_CALLBACK_FUNCTION f, void* p); + +/************ + * EMITTERS * + ************/ + +/** + * Emit the born event + * @param me the ALIVE itself + * @param t time to wait in ms before triggering event + * @param data data to put on the event for XF + */ +void ALIVE_emitBorn(ALIVE* me, uint16_t t, int64_t data); + +/** + * Emit the ready event + * @param me the ALIVE itself + * @param t time to wait in ms before triggering event + * @param data data to put on the event for XF + */ +void ALIVE_emitReady(ALIVE* me, uint16_t t, int64_t data); + +/** + * Emit the poll event + * @param me the ALIVE itself + * @param t time to wait in ms before triggering event + * @param data data to put on the event for XF + */ +void ALIVE_emitPoll(ALIVE* me, uint16_t t, int64_t data); + +/** + * Emit the start event + * @param me the ALIVE itself + * @param t time to wait in ms before triggering event + * @param data data to put on the event for XF + */ +void ALIVE_emitStart(ALIVE* me, uint16_t t, int64_t data); + + +/*********** + * SETTERS * + ***********/ + +void ALIVE_setIsAlive(ALIVE* me, bool v); + +void ALIVE_setHaveBreak(ALIVE* me, bool v); + +void ALIVE_setAliveTime(ALIVE* me, uint8_t v); + +void ALIVE_ISALIVE(ALIVE* me); + +#endif diff --git a/306-controller_interface.X/middleware/alive_checker.c b/306-controller_interface.X/middleware/alive_checker.c deleted file mode 100644 index 00466a4..0000000 --- a/306-controller_interface.X/middleware/alive_checker.c +++ /dev/null @@ -1,176 +0,0 @@ -/** - * @author Rémi Heredero - * @version 1.0.0 - * @date August 2023 - * @file alive_checker.c - */ - -#include "alive_checker.h" - -void ALIVE_CHECKER_init(ALIVE_CHECKER* me){ - me->state = STAC_INIT; - me->isAlive = false; - me->aliveTime = 10; - me->setup.f = NULL; - me->born.f = NULL; - me->wait.f = NULL; - me->dead.f = NULL; -} - -void ALIVE_CHECKER_startBehaviour(ALIVE_CHECKER* me){ - POST(me, &ALIVE_CHECKER_processEvent, evACinit, 0, 0); -} - -bool ALIVE_CHECKER_processEvent(Event* ev) { - bool processed = false; - ALIVE_CHECKER* me = (ALIVE_CHECKER*)Event_getTarget(ev); - ALIVE_CHECKER_STATES oldState = me->state; - evIDT evid = Event_getId(ev); - uint64_t data = Event_getData(ev); - - switch (me->state) { // onState - case STAC_INIT: - if (ev->id == evACinit) { - me->state = STAC_SETUP; - } - break; - - case STAC_SETUP: - if (ev->id == evACborn) { - me->state = STAC_BORN; - } - break; - - case STAC_BORN: - if (ev->id == evACready) { - me->state = STAC_WAIT; - ALIVE_CHECKER_emitPoll(me, me->aliveTime*10, 0); - } - break; - - case STAC_WAIT: - if (ev->id == evACpoll) { - if (me->isAlive) { - me->state = STAC_WAIT; - ALIVE_CHECKER_emitPoll(me, me->aliveTime*10, 0); - } else { - me->state = STAC_DEAD; - } - me->isAlive = false; - } - break; - - case STAC_DEAD: - if(ev->id == evACborn) { - me->state = STAC_BORN; - } - break; - } - - if(oldState != me->state){ - switch (oldState) { // onExit - case STAC_INIT: - break; - - case STAC_SETUP: - break; - - case STAC_BORN: - break; - - case STAC_WAIT: - break; - - case STAC_DEAD: - break; - } - - switch (me->state) { // onEntry - case STAC_INIT: - break; - - case STAC_SETUP: - if (me->setup.f != NULL) { - me->setup.f(me->setup.p); - } - break; - - case STAC_BORN: - if (me->born.f != NULL) { - me->born.f(me->born.p); - } - break; - - case STAC_WAIT: - if (me->wait.f != NULL) { - me->wait.f(me->wait.p); - } - break; - - case STAC_DEAD: - if (me->dead.f != NULL) { - me->dead.f(me->dead.p); - } - break; - } - - processed = true; - } - return processed; -} - -/************* - * Callbacks * - *************/ - -void ALIVE_CHECKER_onSetup(ALIVE_CHECKER* me, ALIVE_CHECKER_CALLBACK_FUNCTION f, void* p) { - me->setup.f = f; - me->setup.p = p; -} - -void ALIVE_CHECKER_onBorn(ALIVE_CHECKER* me, ALIVE_CHECKER_CALLBACK_FUNCTION f, void* p) { - me->born.f = f; - me->born.p = p; -} - -void ALIVE_CHECKER_onWait(ALIVE_CHECKER* me, ALIVE_CHECKER_CALLBACK_FUNCTION f, void* p) { - me->wait.f = f; - me->wait.p = p; -} - -void ALIVE_CHECKER_onDead(ALIVE_CHECKER* me, ALIVE_CHECKER_CALLBACK_FUNCTION f, void* p) { - me->dead.f = f; - me->dead.p = p; -} - -/************ - * EMITTERS * - ************/ - -void ALIVE_CHECKER_emitBorn(ALIVE_CHECKER* me, uint16_t t, int64_t data) { - POST(me, &ALIVE_CHECKER_processEvent, evACborn, t, data); -} - -void ALIVE_CHECKER_emitReady(ALIVE_CHECKER* me, uint16_t t, int64_t data) { - POST(me, &ALIVE_CHECKER_processEvent, evACready, t, data); -} - -void ALIVE_CHECKER_emitPoll(ALIVE_CHECKER* me, uint16_t t, int64_t data) { - POST(me, &ALIVE_CHECKER_processEvent, evACpoll, t, data); -} - -/*********** - * SETTERS * - ***********/ - -void ALIVE_CHECKER_setAliveTime(ALIVE_CHECKER* me, uint8_t v) { - me->aliveTime = v; -} - -void ALIVE_CHECKER_setIsAlive(ALIVE_CHECKER* me, bool v) { - me->isAlive = v; -} - -void ALIVE_CHECKER_ISALIVE(ALIVE_CHECKER* me) { - ALIVE_CHECKER_setIsAlive(me, true); -} diff --git a/306-controller_interface.X/middleware/alive_checker.h b/306-controller_interface.X/middleware/alive_checker.h deleted file mode 100644 index 6b57ac7..0000000 --- a/306-controller_interface.X/middleware/alive_checker.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @author Rémi Heredero - * @version 1.0.0 - * @date August 2023 - * @file alive_checker.h - */ -#ifndef ALIVE_CHECKER_H -#define ALIVE_CHECKER_H - -#include "../xf/xf.h" - -typedef enum { - STAC_INIT, - STAC_SETUP, - STAC_BORN, - STAC_WAIT, - STAC_DEAD -} ALIVE_CHECKER_STATES; - -typedef enum { - evACinit = 15, - evACborn, - evACready, - evACpoll -} ALIVE_CHECKER_EVENTS; - -typedef void (*ALIVE_CHECKER_CALLBACK_FUNCTION)(void*); -typedef struct { - ALIVE_CHECKER_CALLBACK_FUNCTION f; // function - void* p; // param(s) -} ALIVE_CHECKER_CALLBACK; - -typedef struct { - ALIVE_CHECKER_STATES state; - bool isAlive; - uint8_t aliveTime; - ALIVE_CHECKER_CALLBACK setup; - ALIVE_CHECKER_CALLBACK born; - ALIVE_CHECKER_CALLBACK wait; - ALIVE_CHECKER_CALLBACK dead; -} ALIVE_CHECKER; - -/** - * Initialize the ALIVE_CHECKER - * @param me the ALIVE_CHECKER itself - */ -void ALIVE_CHECKER_init(ALIVE_CHECKER* me); - -/** - * Start the ALIVE_CHECKER state machine - * @param me the ALIVE_CHECKER itself - */ -void ALIVE_CHECKER_startBehaviour(ALIVE_CHECKER* me); - -/** - * Process the event - * @param ev the event to process - * @return true if the event is processed - */ -bool ALIVE_CHECKER_processEvent(Event* ev); - -/************* - * Callbacks * - *************/ - -/** - * Set the callback function to call when the ALIVE_CHECKER is entering state setup - * @param me the ALIVE_CHECKER itself - * @param f the function to call - * @param p the param(s) to pass to the function - */ -void ALIVE_CHECKER_onSetup(ALIVE_CHECKER* me, ALIVE_CHECKER_CALLBACK_FUNCTION f, void* p); - -/** - * Set the callback function to call when the ALIVE_CHECKER is entering state born - * @param me the ALIVE_CHECKER itself - * @param f the function to call - * @param p the param(s) to pass to the function - */ -void ALIVE_CHECKER_onBorn(ALIVE_CHECKER* me, ALIVE_CHECKER_CALLBACK_FUNCTION f, void* p); - -/** - * Set the callback function to call when the ALIVE_CHECKER is entering state wait - * @param me the ALIVE_CHECKER itself - * @param f the function to call - * @param p the param(s) to pass to the function - */ -void ALIVE_CHECKER_onWait(ALIVE_CHECKER* me, ALIVE_CHECKER_CALLBACK_FUNCTION f, void* p); - -/** - * Set the callback function to call when the ALIVE_CHECKER is entering state dead - * @param me the ALIVE_CHECKER itself - * @param f the function to call - * @param p the param(s) to pass to the function - */ -void ALIVE_CHECKER_onDead(ALIVE_CHECKER* me, ALIVE_CHECKER_CALLBACK_FUNCTION f, void* p); - -/************ - * EMITTERS * - ************/ - -/** - * Emit the born event - * @param me the ALIVE_CHECKER itself - * @param t time to wait in ms before triggering event - * @param data data to put on the event for XF - */ -void ALIVE_CHECKER_emitBorn(ALIVE_CHECKER* me, uint16_t t, int64_t data); - -/** - * Emit the ready event - * @param me the ALIVE_CHECKER itself - * @param t time to wait in ms before triggering event - * @param data data to put on the event for XF - */ -void ALIVE_CHECKER_emitReady(ALIVE_CHECKER* me, uint16_t t, int64_t data); - -/** - * Emit the poll event - * @param me the ALIVE_CHECKER itself - * @param t time to wait in ms before triggering event - * @param data data to put on the event for XF - */ -void ALIVE_CHECKER_emitPoll(ALIVE_CHECKER* me, uint16_t t, int64_t data); - -/*********** - * SETTERS * - ***********/ - -void ALIVE_CHECKER_setAliveTime(ALIVE_CHECKER* me, uint8_t v); -void ALIVE_CHECKER_setIsAlive(ALIVE_CHECKER* me, bool v); -void ALIVE_CHECKER_ISALIVE(ALIVE_CHECKER* me); // Use this one when you receive CAN message - -#endif diff --git a/306-controller_interface.X/middleware/watchdog.c b/306-controller_interface.X/middleware/watchdog.c deleted file mode 100644 index 5840bf5..0000000 --- a/306-controller_interface.X/middleware/watchdog.c +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @author Rémi Heredero - * @version 1.0.0 - * @date August 2023 - * @file watchdog.c - */ - -#include "watchdog.h" - -void WATCHDOG_init(WATCHDOG* me){ - me->state = STWD_INIT; - me->time = 10; - me->alive.f = NULL; -} - -void WATCHDOG_startBehaviour(WATCHDOG* me){ - POST(me, &WATCHDOG_processEvent, evWDinit, 0, 0); -} - -bool WATCHDOG_processEvent(Event* ev) { - bool processed = false; - WATCHDOG* me = (WATCHDOG*)Event_getTarget(ev); - WATCHDOG_STATES oldState = me->state; - evIDT evid = Event_getId(ev); - uint64_t data = Event_getData(ev); - - switch (me->state) { // onState - case STWD_INIT: - if (ev->id == evWDinit) { - me->state = STWD_ALIVE; - WATCHDOG_emitPoll(me, 10*me->time, 0); - } - break; - - case STWD_ALIVE: - if (ev->id == evWDpoll) { - WATCHDOG_emitPoll(me, 10*me->time, 0); - if (me->alive.f != NULL) { - me->alive.f(me->alive.p); - } - } - break; - } - - if(oldState != me->state){ - switch (oldState) { // onExit - case STWD_INIT: - break; - - case STWD_ALIVE: - break; - } - - switch (me->state) { // onEntry - case STWD_INIT: - break; - - case STWD_ALIVE: - break; - } - - processed = true; - } - return processed; -} - -/************* - * Callbacks * - *************/ - -void WATCHDOG_onAlive(WATCHDOG* me, WATCHDOG_CALLBACK_FUNCTION f, void* p) { - me->alive.f = f; - me->alive.p = p; -} - -/************ - * EMITTERS * - ************/ - -void WATCHDOG_emitPoll(WATCHDOG* me, uint16_t t, int64_t data) { - POST(me, &WATCHDOG_processEvent, evWDpoll, t, data); -} - -/*********** - * SETTERS * - ***********/ - -void WATCHDOG_setTime(WATCHDOG* me, uint8_t v) { - me->time = v; -} diff --git a/306-controller_interface.X/middleware/watchdog.h b/306-controller_interface.X/middleware/watchdog.h deleted file mode 100644 index ed2d184..0000000 --- a/306-controller_interface.X/middleware/watchdog.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @author Rémi Heredero - * @version 1.0.0 - * @date August 2023 - * @file watchdog.h - */ -#ifndef WATCHDOG_H -#define WATCHDOG_H - -#include "../xf/xf.h" - -typedef enum { - STWD_INIT, - STWD_ALIVE -} WATCHDOG_STATES; - -typedef enum { - evWDinit = 20, - evWDpoll -} WATCHDOG_EVENTS; - -typedef void (*WATCHDOG_CALLBACK_FUNCTION)(void*); -typedef struct { - WATCHDOG_CALLBACK_FUNCTION f; // function - void* p; // param(s) -} WATCHDOG_CALLBACK; - -typedef struct { - WATCHDOG_STATES state; - uint8_t time; - WATCHDOG_CALLBACK alive; -} WATCHDOG; - -/** - * Initialize the WATCHDOG - * @param me the WATCHDOG itself - */ -void WATCHDOG_init(WATCHDOG* me); - -/** - * Start the WATCHDOG state machine - * @param me the WATCHDOG itself - */ -void WATCHDOG_startBehaviour(WATCHDOG* me); - -/** - * Process the event - * @param ev the event to process - * @return true if the event is processed - */ -bool WATCHDOG_processEvent(Event* ev); - -/************* - * Callbacks * - *************/ - -/** - * Set the callback function to call when the WATCHDOG is entering state alive - * @param me the WATCHDOG itself - * @param f the function to call - * @param p the param(s) to pass to the function - */ -void WATCHDOG_onAlive(WATCHDOG* me, WATCHDOG_CALLBACK_FUNCTION f, void* p); - -/************ - * EMITTERS * - ************/ - -/** - * Emit the poll event - * @param me the WATCHDOG itself - * @param t time to wait in ms before triggering event - * @param data data to put on the event for XF - */ -void WATCHDOG_emitPoll(WATCHDOG* me, uint16_t t, int64_t data); - -/*********** - * SETTERS * - ***********/ - -void WATCHDOG_setTime(WATCHDOG* me, uint8_t v); - -#endif diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 3dc5c26..d5e1e13 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -26,8 +26,7 @@ middleware/can_interface.h - middleware/alive_checker.h - middleware/watchdog.h + middleware/alive.h xf/event.h @@ -63,8 +62,7 @@ middleware/can_interface.c - middleware/alive_checker.c - middleware/watchdog.c + middleware/alive.c xf/event.c @@ -94,7 +92,7 @@ PICkit3PlatformTool XC8 2.41 - 2 + 3 diff --git a/UML/alive.pdf b/UML/alive.pdf index 75b99e57b0615e294c094164e6f3c290aa07eb5b..47870de23692ec49421a6752b17b97330e54098a 100644 GIT binary patch delta 3029 zcmai0c{CJm7mj2Y`_9+~5fZbS8Duy1bu1HQGM4PJE6eH~saA+V>N9nNJB za}C#I@>`e$uI-yZZL7uiKWr4WR>f4>XYzJ9I7Y1)?w(dqcvw;W);RFvZAnt)*|%Q@ z8j`=Xdk3DL$pIw>8Re+T;Ct$wqk@aNEk!%fdzGZe0FdNnY@@)l(7k2{uQ%Nn8qJT{ z&hUQZ_n~towpaP@cyv@LJ-o#0_%i8zQyF@HUVB)GmWyujw$qLzvX?`G(7xUvg?eZS~w~pN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ive.uxf index e54aa37..859c367 100644 --- a/UML/alive.uxf +++ b/UML/alive.uxf @@ -1,13 +1,13 @@ - 15 + 14 UMLSpecialState - 510 - 30 - 30 - 30 + 714 + 28 + 56 + 56 type=initial @@ -15,47 +15,48 @@ Relation - 510 - 45 - 90 - 105 + 462 + 70 + 308 + 154 lt=-> -evInit - 10.0;10.0;10.0;50.0 +evInitChecker + 200.0;10.0;200.0;50.0;10.0;50.0;10.0;90.0 UMLState - 390 - 120 - 285 - 90 + 350 + 196 + 266 + 112 SETUP -- -/entry: sendParamsOnCan +/entry: sendParamsOnCan +/entry: checker = true Relation - 510 - 195 - 105 - 105 + 462 + 294 + 98 + 98 lt=-> -evBorn +m1=evBorn 10.0;10.0;10.0;50.0 UMLState - 390 - 270 - 285 - 90 + 350 + 364 + 266 + 84 BORN -- @@ -65,10 +66,10 @@ evBorn UMLState - 390 - 420 - 285 - 120 + 350 + 504 + 266 + 112 WAIT -- @@ -80,22 +81,22 @@ isAlive = false Relation - 510 - 345 - 120 - 105 + 462 + 434 + 112 + 98 lt=-> -evReady +m1=evReady 10.0;10.0;10.0;50.0 UMLState - 390 - 720 - 285 - 90 + 350 + 784 + 266 + 84 DEAD -- @@ -105,94 +106,166 @@ evReady Relation - 510 - 525 - 105 - 105 - - lt=-> -evPoll - 10.0;10.0;10.0;50.0 - - - UMLSpecialState - - 495 - 600 - 60 - 60 - - type=decision - - - - Relation - - 510 - 645 - 90 - 105 - - lt=-> -m1=[else] - 10.0;10.0;10.0;50.0 - - - Relation - - 315 - 465 + 280 + 546 210 - 210 + 182 lt=-> -m1=[isAlive] - 120.0;110.0;10.0;110.0;10.0;10.0;50.0;10.0 +m1=evPoll\n[isAlive] + 80.0;50.0;80.0;110.0;10.0;110.0;10.0;10.0;50.0;10.0 Relation - 660 - 135 - 210 - 405 + 224 + 392 + 336 + 560 lt=-> -evDisable - 10.0;250.0;60.0;250.0;60.0;10.0;10.0;10.0 - - - Relation - - 255 - 300 - 300 - 600 - - lt=-> -evBorn +m1=evBorn 180.0;340.0;180.0;380.0;10.0;380.0;10.0;10.0;90.0;10.0 Relation - 660 - 495 - 120 - 315 + 462 + 602 + 112 + 210 - lt=- - 10.0;190.0;60.0;190.0;60.0;10.0 + lt=-> +m1=evPoll\n[default] + 10.0;10.0;10.0;130.0 Relation - 660 - 315 - 120 - 45 + 728 + 70 + 308 + 154 - lt=- - 10.0;10.0;60.0;10.0 + lt=-> +evInitSender + 10.0;10.0;10.0;50.0;200.0;50.0;200.0;90.0 + + + Relation + + 784 + 252 + 224 + 140 + + lt=-> +m1=evPoll\n[else] + 100.0;40.0;100.0;70.0;10.0;70.0;10.0;10.0;60.0;10.0 + + + UMLNote + + 784 + 28 + 140 + 56 + + read time on +EPROM + + + + UMLState + + 868 + 196 + 266 + 112 + + ALIVE +-- +\entry: sender = true +-- +sendAliveOnCan + + + + UMLState + + 868 + 518 + 266 + 84 + + lt=.. +BREAK +-.. + + + + + Relation + + 994 + 294 + 210 + 252 + + lt=..> +m1=evPoll\n[time==0]\n[haveBreak] + 60.0;10.0;60.0;110.0;10.0;110.0;10.0;160.0 + + + Relation + + 560 + 546 + 336 + 182 + + lt=..> +m1=evPoll\n[time==0]\n[haveBreak] + 10.0;50.0;10.0;110.0;90.0;110.0;180.0;10.0;220.0;10.0 + + + Relation + + 602 + 546 + 420 + 182 + + lt=..> +m1=evStart\n[checker] + 220.0;40.0;220.0;110.0;150.0;110.0;60.0;10.0;10.0;10.0 + + + Relation + + 1078 + 252 + 182 + 476 + + lt=..> +m1=evStart\n[sender] + 10.0;250.0;10.0;320.0;110.0;320.0;110.0;10.0;40.0;10.0 + + + UMLNote + + 868 + 728 + 266 + 154 + + lt=.. +break part can be disable +with setHaveBreak(false) + +not all childrens have a break +for time at 0 + From 7e5d85070f6b0098b5422b774da5468ad938ef37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 29 Aug 2023 14:38:50 +0200 Subject: [PATCH 23/50] add can sequence --- UML/can_sequence.png | Bin 0 -> 32882 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 UML/can_sequence.png diff --git a/UML/can_sequence.png b/UML/can_sequence.png new file mode 100644 index 0000000000000000000000000000000000000000..22a7e7072f40b1963d7e6dbedbe03e0f1ffd9e9e GIT binary patch literal 32882 zcmdqJ1yogQ^gRmF9g+f)A{~N+bb}%#oeD@RrF1t4NP`HHD$?Bul8PW5f~2B?gpx|W zbug~p_`mmluf}+H+&jkAbIy)$uWzoo=3HxstEnj9VV}ZALPEk*Qk2y|LOO90{xios z0e{2vo*(f6+bucWTW0nS?snHLZXqdLzj@v1+O6y6bf)ffR<~|BIA7rAcCfp4^VaPf zc3fumH(XwI(;^`ums)G;-un6XNXT#;x3ol!$%}20gx(n?DGG9IO?ir^WiJ=#8gO<- zWHLdro`agR zwvrakin_JxXvjp@J1rNCHUATHZ{;E-J{TCrNh=6Fts$mv7KnN;tzj-3z&~MdMc_q5 z+DW~zpcG9nF>7KMnco=IR`&AaF{L*qI`_2jK`zGq zEMhu}@$5!SDWmDD*U06i$^BQDmeDlYqE^m5vqm>DieBlpZNT3~Lh?~il9keQGhR-| zG1TgqI4Y~fVzM!=jiAe(ojUh0p~snn&s(cL?ZQ+~e2VG4L*eP}a>Bbw81cg-m4nNd zPn@snsa(!I9rLb{&O$I=nKSmz8%;IM!@g@yRfZKirFzTfJuOx~?CE73+&kzgta{)+ z+Ot2ptmkQ;?13sph-!_^rH>LohZ(>lwIE4|DwT@Ph5>&Z@F_m@fg=BCZT{Y3Ve!|loVvnrY~c!O7wMc&!CA`T|R zkmmGmVWH{k{JvRN1Zl6D{nb!ImYgX(#Lt6uyOB4r2+{R<_^A?}-Gj4+ZTpTgEeg``1;m|9WwUvfrQDgkMp8nnba9DmkO?>!qu63pp{E6-|N+Jr} zsr9L7&FIa|%`*aoR8$4$^-e@T5<`ZEVTu&3iBF{$;0(V}?oDLZsbnrYep-%9p#-#t zU*F!X(*E%mxVLZLhK(E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QzbHCGU{nL|tkMBy+Vvf*4aEBgtcB~*`~UHX;jl-(c(qN13P&{fr=p-CUo30t{r><8 CHYIET literal 0 HcmV?d00001 From 19547261bd79a1e5e065754e0ba84de2300e1549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 29 Aug 2023 15:18:04 +0200 Subject: [PATCH 24/50] move enable global interrupt --- 306-controller_interface.X/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/306-controller_interface.X/main.c b/306-controller_interface.X/main.c index 6a05435..d81327c 100644 --- a/306-controller_interface.X/main.c +++ b/306-controller_interface.X/main.c @@ -10,8 +10,6 @@ void main(void) // Initialize the device SYSTEM_Initialize(); - // Enable the Global Interrupts - INTERRUPT_GlobalInterruptEnable(); // Disable the Global Interrupts // INTERRUPT_GlobalInterruptDisable(); @@ -29,6 +27,8 @@ void main(void) // TMR0 is interrupting. Important: Set the TICKINTERVAL define in //the xf.h file to the same value as the TMR0 value. TMR0_SetInterruptHandler(XF_decrementAndQueueTimers); + // Enable the Global Interrupts + INTERRUPT_GlobalInterruptEnable(); while (1) { From d26155061d64c2016ab4b3ae23a258f360cba64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 29 Aug 2023 15:40:04 +0200 Subject: [PATCH 25/50] update uml --- UML/alive.uxf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UML/alive.uxf b/UML/alive.uxf index 859c367..f68ad3c 100644 --- a/UML/alive.uxf +++ b/UML/alive.uxf @@ -226,7 +226,7 @@ m1=evPoll\n[time==0]\n[haveBreak] lt=..> m1=evPoll\n[time==0]\n[haveBreak] - 10.0;50.0;10.0;110.0;90.0;110.0;180.0;10.0;220.0;10.0 + 10.0;50.0;10.0;110.0;90.0;110.0;170.0;10.0;220.0;10.0 Relation @@ -238,7 +238,7 @@ m1=evPoll\n[time==0]\n[haveBreak] lt=..> m1=evStart\n[checker] - 220.0;40.0;220.0;110.0;150.0;110.0;60.0;10.0;10.0;10.0 + 220.0;40.0;220.0;110.0;140.0;110.0;60.0;10.0;10.0;10.0 Relation From f755095523c4776794cd34116175fd100c91f192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 29 Aug 2023 15:50:04 +0200 Subject: [PATCH 26/50] permanent memory --- 306-controller_interface.X/middleware/eeprom.c | 6 +++++- 306-controller_interface.X/middleware/eeprom.h | 1 + 306-controller_interface.X/nbproject/configurations.xml | 5 ++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/306-controller_interface.X/middleware/eeprom.c b/306-controller_interface.X/middleware/eeprom.c index 48c8a58..e3041d6 100644 --- a/306-controller_interface.X/middleware/eeprom.c +++ b/306-controller_interface.X/middleware/eeprom.c @@ -31,7 +31,7 @@ void MEM_init(){ CAR_CST.CONTROL_MAX_SPEED_BW = 0; CAR_CST.JOYSTICK_MODE = 0; - CAR_CST.JOYSTICK_PARAM1 = 100; + CAR_CST.JOYSTICK_PARAM1 = 10; CAR_CST.JOYSTICK_PARAM2 = 1; CAR_CST.JOYSTICK_ALIVE_TIME = 10; @@ -105,6 +105,10 @@ void MEM_init(){ } } +void MEM_reset() { + MEM_write_1_byte(0x0, 0x0); +} + void MEM_write_1_byte(uint8_t address, uint8_t data) { DATAEE_WriteByte(address, data); } diff --git a/306-controller_interface.X/middleware/eeprom.h b/306-controller_interface.X/middleware/eeprom.h index 62a0ee6..dbf0bb8 100644 --- a/306-controller_interface.X/middleware/eeprom.h +++ b/306-controller_interface.X/middleware/eeprom.h @@ -12,6 +12,7 @@ #include "../mcc_generated_files/mcc.h" void MEM_init(); +void MEM_reset(); void MEM_write_1_byte(uint8_t address, uint8_t data); void MEM_write_4_byte(uint8_t address, uint32_t data); uint8_t MEM_read_1_byte(uint8_t address); diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 3dc5c26..81887fd 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -216,7 +216,6 @@ - @@ -239,7 +238,7 @@ - + @@ -778,7 +777,7 @@ - + From debececcfd361516482cf77d88025768ef0e70e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 29 Aug 2023 16:28:12 +0200 Subject: [PATCH 27/50] add reset memory by can --- 306-controller_interface.X/app/can_message.c | 5 ++++- threewheeler.DBF | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 2e5cca0..d8d9a97 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -30,9 +30,12 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ *********************/ case 0: if(idMsg == 0x0) { // CONTROL_SETUP - // steeringMode - - controlAliveTime + // steeringMode eraseMemory - controlAliveTime BYTES_4 tmpData; tmpData.full.bytes = data; + if (tmpData.separate.byte1) { + MEM_reset(); + } CAR_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0; CAR_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3; MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); diff --git a/threewheeler.DBF b/threewheeler.DBF index 727ded4..b2261ba 100644 --- a/threewheeler.DBF +++ b/threewheeler.DBF @@ -38,10 +38,11 @@ [VALUE_DESCRIPTION] RACE,2 [END_MSG] -[START_MSG] CONTROL_SETUP,16,4,2,1,S +[START_MSG] CONTROL_SETUP,16,4,3,1,S [START_SIGNALS] AliveTime,8,4,0,U,255,0,1,0.000000,10.000000,mS, [VALUE_DESCRIPTION] No alive message,0 [START_SIGNALS] STEERING_MODE,1,1,0,B,1,0,1,0.000000,1.000000,, +[START_SIGNALS] ERASE_MEMORY,1,2,0,B,1,0,1,0.000000,1.000000,, [END_MSG] [START_MSG] CONTROL_SPEED_FACTOR,17,4,1,1,S From 7550d1907b4a9eaf04485b25158815a41ce9758c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Wed, 30 Aug 2023 15:37:53 +0200 Subject: [PATCH 28/50] all setup with memory settings --- 306-controller_interface.X/app/can_message.c | 187 +++++-- 306-controller_interface.X/app/can_message.h | 61 ++- 306-controller_interface.X/app/car.h | 11 +- .../app/factory/factory.c | 6 +- .../mcc_generated_files/memory.c | 1 - .../middleware/eeprom.c | 120 ++--- busmaster_config.cfx | 466 +++++++++++++++--- 7 files changed, 684 insertions(+), 168 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index d8d9a97..3fa19b1 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -17,9 +17,7 @@ typedef union { uint8_t byte2; uint8_t byte3; } separate; - struct { - uint32_t bytes; - } full; + uint32_t full; } BYTES_4; void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ @@ -32,67 +30,109 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0x0) { // CONTROL_SETUP // steeringMode eraseMemory - controlAliveTime BYTES_4 tmpData; - tmpData.full.bytes = data; + tmpData.full = data; if (tmpData.separate.byte1) { MEM_reset(); } - CAR_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0; - CAR_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3; - MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); - MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME); - ALIVE_setAliveTime(ALcontroller(), CAR_CST.CONTROL_ALIVE_TIME); + KART_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0; + KART_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3; + MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, KART_CST.CONTROL_STEERING_MODE); + MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, KART_CST.CONTROL_ALIVE_TIME); + ALIVE_setAliveTime(ALcontroller(), KART_CST.CONTROL_ALIVE_TIME); } if(idMsg == 0x1) { // CONTROL_SPEED_FACTOR // valHH valH valL valLL + KART_CST.CONTROL_SPEED_FACTOR = data; + MEM_write_4_byte(MEMADD_CONTROL_SPEED_FACTOR, KART_CST.CONTROL_SPEED_FACTOR); } if(idMsg == 0x2) { // CONTROL_POWER_FACTOR // valHH valH valL valLL + KART_CST.CONTROL_POWER_FACTOR = data; + MEM_write_4_byte(MEMADD_CONTROL_POWER_FACTOR, KART_CST.CONTROL_POWER_FACTOR); } if(idMsg == 0x3) { // CONTROL_STEERING_FACTOR // valHH valH valL valLL + KART_CST.CONTROL_STEERING_FACTOR = data; + MEM_write_4_byte(MEMADD_CONTROL_STEERING_FACTOR, KART_CST.CONTROL_STEERING_FACTOR); } if(idMsg == 0x4) { // CONTROL_SECURITY_PARAM // maxSpeedFw maxSpeedBw - - + BYTES_4 tmpData; + tmpData.full = data; + KART_CST.CONTROL_MAX_SPEED_FW = tmpData.separate.byte0; + KART_CST.CONTROL_MAX_SPEED_BW = tmpData.separate.byte1; + MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_FW, KART_CST.CONTROL_MAX_SPEED_FW); + MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_BW, KART_CST.CONTROL_MAX_SPEED_BW); } if(idMsg == 0x5) { // CONTROL_SETUP_PARAM // displayAliveTime steeringAliveTime - - + BYTES_4 tmpData; + tmpData.full = data; + KART_CST.DISPLAY_ALIVE_TIME = tmpData.separate.byte0; + KART_CST.STEERING_ALIVE_TIME = tmpData.separate.byte1; + MEM_write_1_byte(MEMADD_DISPLAY_ALIVE_TIME, KART_CST.DISPLAY_ALIVE_TIME); + MEM_write_1_byte(MEMADD_STEERING_ALIVE_TIME, KART_CST.STEERING_ALIVE_TIME); + // TODO set alive times + // TODO send params } if(idMsg == 0x6) { // CONTROL_SETUP_PARAM_JOY // joystickMode joystickParam1 joystickParam2 joystickAliveTime BYTES_4 tmpData; - tmpData.full.bytes = data; - CAR_CST.JOYSTICK_MODE = tmpData.separate.byte0; - CAR_CST.JOYSTICK_PARAM1 = tmpData.separate.byte1; - CAR_CST.JOYSTICK_PARAM2 = tmpData.separate.byte2; - CAR_CST.JOYSTICK_ALIVE_TIME = tmpData.separate.byte3; - MEM_write_1_byte(MEMADD_JOYSTICK_MODE, CAR_CST.JOYSTICK_MODE); - MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, CAR_CST.JOYSTICK_PARAM1); - MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, CAR_CST.JOYSTICK_PARAM2); - MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.JOYSTICK_ALIVE_TIME); + tmpData.full = data; + KART_CST.JOYSTICK_MODE = tmpData.separate.byte0; + KART_CST.JOYSTICK_PARAM1 = tmpData.separate.byte1; + KART_CST.JOYSTICK_PARAM2 = tmpData.separate.byte2; + KART_CST.JOYSTICK_ALIVE_TIME = tmpData.separate.byte3; + MEM_write_1_byte(MEMADD_JOYSTICK_MODE, KART_CST.JOYSTICK_MODE); + MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, KART_CST.JOYSTICK_PARAM1); + MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, KART_CST.JOYSTICK_PARAM2); + MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, KART_CST.JOYSTICK_ALIVE_TIME); - ALIVE_setAliveTime(ALjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); + ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME); CM_JOY_SETUP(NULL); } if(idMsg == 0x7) { // CONTROL_SETUP_PARAM_DRIVE // driveAliveTime driveSpeedTime driveStopTime - + BYTES_4 tmpData; + tmpData.full = data; + KART_CST.DRIVE_ALIVE_TIME = tmpData.separate.byte0; + KART_CST.DRIVE_SPEED_TIME = tmpData.separate.byte1; + KART_CST.DRIVE_STOP_TIME = tmpData.separate.byte2; + MEM_write_1_byte(MEMADD_DRIVE_ALIVE_TIME, KART_CST.DRIVE_ALIVE_TIME); + MEM_write_1_byte(MEMADD_DRIVE_SPEED_TIME, KART_CST.DRIVE_SPEED_TIME); + MEM_write_1_byte(MEMADD_DRIVE_STOP_TIME, KART_CST.DRIVE_STOP_TIME); + // TODO set alive time + // TODO send params } if(idMsg == 0x8) { // CONTROL_SETUP_PARAM_BATTERY // batteryVoltTime batteryCurrentTime batteryEnergyTime batteryAliveTime + BYTES_4 tmpData; + tmpData.full = data; + KART_CST.BATTERY_VOLT_TIME = tmpData.separate.byte0; + KART_CST.BATTERY_CURRENT_TIME = tmpData.separate.byte1; + KART_CST.BATTERY_ENERGY_TIME = tmpData.separate.byte2; + KART_CST.BATTERY_ALIVE_TIME = tmpData.separate.byte3; + MEM_write_1_byte(MEMADD_BATTERY_VOLT_TIME, KART_CST.BATTERY_VOLT_TIME); + MEM_write_1_byte(MEMADD_BATTERY_CURRENT_TIME, KART_CST.BATTERY_CURRENT_TIME); + MEM_write_1_byte(MEMADD_BATTERY_ENERGY_TIME, KART_CST.BATTERY_ENERGY_TIME); + MEM_write_1_byte(MEMADD_BATTERY_ALIVE_TIME, KART_CST.BATTERY_ALIVE_TIME); + // TODO set alive time + // TODO send params } @@ -112,11 +152,11 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ // - - - - ALIVE_ISALIVE(ALjoy()); if(ALjoy()->state == STAL_DEAD){ - CAR_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE); - CAR_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1); - CAR_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2); - CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); - ALIVE_setAliveTime(ALjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); + KART_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE); + KART_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1); + KART_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2); + KART_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); + ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME); ALIVE_emitBorn(ALjoy(), 0, 0); ALIVE_emitReady(ALjoy(), 100, 0); } @@ -130,6 +170,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 3: if(idMsg == 0xF) { // DISPLAY_ALIVE // powerMode - - - + // TODO display say ALIVE } break; @@ -146,6 +187,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0xF) { // DRIVE_ALIVE // statusH statusL - - + // TODO drive say ALIVE } break; @@ -167,6 +209,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0xF) { // STEERING_ALIVE // statusH statusL - - + // TODO steering say ALIVE with his status } break; @@ -178,6 +221,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 6: if(idMsg == 0xF) { // BATTERY_ALIVE // - - - - + // TODO battery say ALIVE } break; @@ -192,46 +236,113 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ } void CM_CONTROLLER_ALIVE(void* p) { + // - - - - CAN_Send(0x0, 0xF, 0); } void CM_JOY_SETUP(void* p) { + // mode parm1 param2 aliveTime BYTES_4 joy; - joy.separate.byte0 = CAR_CST.JOYSTICK_MODE; - joy.separate.byte1 = CAR_CST.JOYSTICK_PARAM1; - joy.separate.byte2 = CAR_CST.JOYSTICK_PARAM2; - joy.separate.byte3 = CAR_CST.JOYSTICK_ALIVE_TIME; - CAN_Send(2, 0, joy.full.bytes); - + joy.separate.byte0 = KART_CST.JOYSTICK_MODE; + joy.separate.byte1 = KART_CST.JOYSTICK_PARAM1; + joy.separate.byte2 = KART_CST.JOYSTICK_PARAM2; + joy.separate.byte3 = KART_CST.JOYSTICK_ALIVE_TIME; + CAN_Send(2, 0, joy.full); } void CM_DISPLAY_SETUP(void* p) { - + // reset - - aliveTime + BYTES_4 display; + display.separate.byte0 = 0; // reset + display.separate.byte3 = KART_CST.DISPLAY_ALIVE_TIME; + CAN_Send(3, 0, display.full); } void CM_DISPLAY_SPEED(void* p) { - + // valH valL - - + BYTES_4 tmpData; + // byte0 should be valH but isn't possible to go enough fast for use it + tmpData.separate.byte0 = 0; + tmpData.separate.byte1 = *((uint8_t*) p); + tmpData.separate.byte2 = 0; + tmpData.separate.byte3 = 0; + CAN_Send(3, 2, tmpData.full); } void CM_DISPLAY_DIRECTION(void* p) { - + // direction - - - + BYTES_4 tmpData; + tmpData.separate.byte0 = (uint8_t) p; + tmpData.separate.byte1 = 0; + tmpData.separate.byte2 = 0; + tmpData.separate.byte3 = 0; + CAN_Send(3, 3, tmpData.full); } void CM_DRIVE_SETUP(void* p) { + // reset/init speedTime stopTime aliveTime + BYTES_4 tmpData; + tmpData.separate.byte0 = (uint8_t) p; + tmpData.separate.byte1 = KART_CST.DRIVE_SPEED_TIME; + tmpData.separate.byte2 = KART_CST.DRIVE_STOP_TIME; + tmpData.separate.byte3 = KART_CST.DRIVE_ALIVE_TIME; + CAN_Send(4, 0, tmpData.full); } void CM_DRIVE_POWER(void* p) { - + // valH valL - - + // TODO } void CM_STEERING_SETUP(void* p) { - + // reset/init homing setCenter aliveTime + // TODO not working have to fix it + BYTES_4 tmpData; + uint8_t choice = (uint8_t) p; + switch (choice) { + case 1: + tmpData.separate.byte0 = 1; + tmpData.separate.byte1 = 0; + tmpData.separate.byte2 = 0; + break; + case 2: + tmpData.separate.byte0 = 0; + tmpData.separate.byte1 = 1; + tmpData.separate.byte2 = 0; + break; + case 3: + tmpData.separate.byte0 = 0; + tmpData.separate.byte1 = 0; + tmpData.separate.byte2 = 1; + break; + default: + tmpData.separate.byte0 = 0; + tmpData.separate.byte1 = 0; + tmpData.separate.byte2 = 0; + break; + } + tmpData.separate.byte3 = KART_CST.STEERING_ALIVE_TIME; // 0 -> no alive + CAN_Send(5, 0, tmpData.full); } void CM_STEERING_SET(void* p) { - + // valHH valH valL valLL + BYTES_4 pPosition; + pPosition.full = *((uint32_t*) p); + BYTES_4 sPosition; + sPosition.separate.byte0 = pPosition.separate.byte3; + sPosition.separate.byte1 = pPosition.separate.byte2; + sPosition.separate.byte2 = pPosition.separate.byte1; + sPosition.separate.byte3 = pPosition.separate.byte0; + CAN_Send(5, 1, sPosition.full); } -void CM_SETUP_CONTROL(void* p) { - +void CM_SUPPLY_SETUP(void* p) { + // batteryVoltTime batteryCurrentTime batteryEnergyTime aliveTime + BYTES_4 supply; + supply.separate.byte0 = KART_CST.BATTERY_VOLT_TIME; + supply.separate.byte1 = KART_CST.BATTERY_CURRENT_TIME; + supply.separate.byte2 = KART_CST.BATTERY_ENERGY_TIME; + supply.separate.byte3 = KART_CST.BATTERY_ALIVE_TIME; + CAN_Send(6, 0, supply.full); } diff --git a/306-controller_interface.X/app/can_message.h b/306-controller_interface.X/app/can_message.h index 5e39140..64bab11 100644 --- a/306-controller_interface.X/app/can_message.h +++ b/306-controller_interface.X/app/can_message.h @@ -26,17 +26,76 @@ S R M 1 6 0 SETUP_CONTROL batteryVoltTime batteryCurrentTime batteryEnergyTime aliveTime */ +/** + * Process an incoming message + * @param idSender id of the sender + * @param idMsg is of the message + * @param data data of the message + */ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data); + +/** + * Send alive message from controller + * @param p have to be NULL + */ void CM_CONTROLLER_ALIVE(void* p); + +/** + * Send setup to the joystick (settings from memory) + * @param p have to be NULL + */ void CM_JOY_SETUP(void* p); + +/** + * Send setup to the display (settings from memory) + * @param p have to be NULL + */ void CM_DISPLAY_SETUP(void* p); + +/** + * Send speed to display + * @param p the speed in 100m/h (max 255 m/h) + */ void CM_DISPLAY_SPEED(void* p); + +/** + * Send direction of the steering wheel + * 0 is straight forward + * positive value is going right + * negative value is going left + * @param p the direction (int 8) + */ void CM_DISPLAY_DIRECTION(void* p); + +/** + * Send setup to the drive + * use with reset in parameter + * other settings from memory + * @param p 1 if reset/init 0 else + */ void CM_DRIVE_SETUP(void* p); + void CM_DRIVE_POWER(void* p); + +/** + * Send setup to the steering + * can be use for reset (1), homing (2) and setCenter (3) + * @param p 0 for setup, 1 for reset, 2 for homing, 3 for setCenter + */ void CM_STEERING_SETUP(void* p); + +/** + * Send position for steering + * no negative value because 0 is home (sensor) + * @param p the position (uint32_t*) + */ void CM_STEERING_SET(void* p); -void CM_SETUP_CONTROL(void* p); + +/** + * Send setup to the supply (settings from memory) + * @param p have to be NULL + */ +void CM_SUPPLY_SETUP(void* p); #endif /* CAN_MESSAGE_H */ diff --git a/306-controller_interface.X/app/car.h b/306-controller_interface.X/app/car.h index d1ba7a7..5551386 100644 --- a/306-controller_interface.X/app/car.h +++ b/306-controller_interface.X/app/car.h @@ -65,8 +65,15 @@ typedef struct { uint8_t BATTERY_CURRENT_TIME; uint8_t BATTERY_ENERGY_TIME; uint8_t BATTERY_ALIVE_TIME; -} CAR_CST_TYPE; -CAR_CST_TYPE CAR_CST; +} KART_CST_TYPE; +KART_CST_TYPE KART_CST; + +typedef struct { + int32_t speed; + uint32_t center; + uint32_t position; +} KART_VAR_TYPE; +KART_VAR_TYPE eKart; #endif /* CAR_H */ diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index fe819c8..2964f29 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -63,12 +63,10 @@ void Factory_init() { CAN_setSender(1); LED_off(l1()); - // TODO init EPROM interface MEM_init(); - // TODO init watchdog with EPROM CST ALIVE_init(ALcontroller()); - ALIVE_setAliveTime(ALcontroller(), CAR_CST.CONTROL_ALIVE_TIME); + ALIVE_setAliveTime(ALcontroller(), KART_CST.CONTROL_ALIVE_TIME); ALIVE_init(ALjoy()); } @@ -81,7 +79,7 @@ void Factory_build() { ALIVE_onAlive(ALcontroller(), CM_CONTROLLER_ALIVE, NULL); ALIVE_onSetup(ALjoy(), CM_JOY_SETUP, NULL); - ALIVE_setAliveTime(ALjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); + ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME); ALIVE_onBorn(ALjoy(), LED_on, l1()); ALIVE_onDead(ALjoy(), LED_off, l1()); diff --git a/306-controller_interface.X/mcc_generated_files/memory.c b/306-controller_interface.X/mcc_generated_files/memory.c index b53aa2c..a2ebbd8 100644 --- a/306-controller_interface.X/mcc_generated_files/memory.c +++ b/306-controller_interface.X/mcc_generated_files/memory.c @@ -198,7 +198,6 @@ uint8_t DATAEE_ReadByte(uint16_t bAdd) void MEMORY_Tasks( void ) { - /* TODO : Add interrupt handling code */ PIR0bits.NVMIF = 0; } /** diff --git a/306-controller_interface.X/middleware/eeprom.c b/306-controller_interface.X/middleware/eeprom.c index e3041d6..6be123a 100644 --- a/306-controller_interface.X/middleware/eeprom.c +++ b/306-controller_interface.X/middleware/eeprom.c @@ -22,85 +22,85 @@ typedef union { void MEM_init(){ uint8_t check = MEM_read_1_byte(0x0); if(check != 0x42){ - CAR_CST.CONTROL_STEERING_MODE = 0; - CAR_CST.CONTROL_ALIVE_TIME = 50; - CAR_CST.CONTROL_SPEED_FACTOR = 0; - CAR_CST.CONTROL_POWER_FACTOR = 0; - CAR_CST.CONTROL_STEERING_FACTOR = 0; - CAR_CST.CONTROL_MAX_SPEED_FW = 0; - CAR_CST.CONTROL_MAX_SPEED_BW = 0; + KART_CST.CONTROL_STEERING_MODE = 0; + KART_CST.CONTROL_ALIVE_TIME = 50; + KART_CST.CONTROL_SPEED_FACTOR = 0; + KART_CST.CONTROL_POWER_FACTOR = 0; + KART_CST.CONTROL_STEERING_FACTOR = 0; + KART_CST.CONTROL_MAX_SPEED_FW = 0; + KART_CST.CONTROL_MAX_SPEED_BW = 0; - CAR_CST.JOYSTICK_MODE = 0; - CAR_CST.JOYSTICK_PARAM1 = 10; - CAR_CST.JOYSTICK_PARAM2 = 1; - CAR_CST.JOYSTICK_ALIVE_TIME = 10; + KART_CST.JOYSTICK_MODE = 0; + KART_CST.JOYSTICK_PARAM1 = 5; + KART_CST.JOYSTICK_PARAM2 = 1; + KART_CST.JOYSTICK_ALIVE_TIME = 25; - CAR_CST.DISPLAY_ALIVE_TIME = 50; + KART_CST.DISPLAY_ALIVE_TIME = 100; - CAR_CST.DRIVE_SPEED_TIME = 0; - CAR_CST.DRIVE_STOP_TIME = 0; - CAR_CST.DRIVE_ALIVE_TIME = 10; + KART_CST.DRIVE_SPEED_TIME = 0; + KART_CST.DRIVE_STOP_TIME = 0; + KART_CST.DRIVE_ALIVE_TIME = 10; - CAR_CST.STEERING_ALIVE_TIME = 100; + KART_CST.STEERING_ALIVE_TIME = 100; - CAR_CST.BATTERY_VOLT_TIME = 50; - CAR_CST.BATTERY_CURRENT_TIME = 50; - CAR_CST.BATTERY_ENERGY_TIME = 50; - CAR_CST.BATTERY_ALIVE_TIME = 50; + KART_CST.BATTERY_VOLT_TIME = 50; + KART_CST.BATTERY_CURRENT_TIME = 50; + KART_CST.BATTERY_ENERGY_TIME = 50; + KART_CST.BATTERY_ALIVE_TIME = 50; - MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); - MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, CAR_CST.CONTROL_ALIVE_TIME); - MEM_write_4_byte(MEMADD_CONTROL_SPEED_FACTOR, CAR_CST.CONTROL_SPEED_FACTOR); - MEM_write_4_byte(MEMADD_CONTROL_POWER_FACTOR, CAR_CST.CONTROL_POWER_FACTOR); - MEM_write_4_byte(MEMADD_CONTROL_STEERING_FACTOR, CAR_CST.CONTROL_STEERING_FACTOR); - MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_FW, CAR_CST.CONTROL_MAX_SPEED_FW); - MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_BW, CAR_CST.CONTROL_MAX_SPEED_BW); + MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, KART_CST.CONTROL_STEERING_MODE); + MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, KART_CST.CONTROL_ALIVE_TIME); + MEM_write_4_byte(MEMADD_CONTROL_SPEED_FACTOR, KART_CST.CONTROL_SPEED_FACTOR); + MEM_write_4_byte(MEMADD_CONTROL_POWER_FACTOR, KART_CST.CONTROL_POWER_FACTOR); + MEM_write_4_byte(MEMADD_CONTROL_STEERING_FACTOR, KART_CST.CONTROL_STEERING_FACTOR); + MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_FW, KART_CST.CONTROL_MAX_SPEED_FW); + MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_BW, KART_CST.CONTROL_MAX_SPEED_BW); - MEM_write_1_byte(MEMADD_JOYSTICK_MODE, CAR_CST.JOYSTICK_MODE); - MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, CAR_CST.JOYSTICK_PARAM1); - MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, CAR_CST.JOYSTICK_PARAM2); - MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, CAR_CST.JOYSTICK_ALIVE_TIME); + MEM_write_1_byte(MEMADD_JOYSTICK_MODE, KART_CST.JOYSTICK_MODE); + MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, KART_CST.JOYSTICK_PARAM1); + MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, KART_CST.JOYSTICK_PARAM2); + MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, KART_CST.JOYSTICK_ALIVE_TIME); - MEM_write_1_byte(MEMADD_DISPLAY_ALIVE_TIME, CAR_CST.DISPLAY_ALIVE_TIME); + MEM_write_1_byte(MEMADD_DISPLAY_ALIVE_TIME, KART_CST.DISPLAY_ALIVE_TIME); - MEM_write_1_byte(MEMADD_DRIVE_SPEED_TIME, CAR_CST.DRIVE_SPEED_TIME); - MEM_write_1_byte(MEMADD_DRIVE_STOP_TIME, CAR_CST.DRIVE_STOP_TIME); - MEM_write_1_byte(MEMADD_DRIVE_ALIVE_TIME, CAR_CST.DRIVE_ALIVE_TIME); + MEM_write_1_byte(MEMADD_DRIVE_SPEED_TIME, KART_CST.DRIVE_SPEED_TIME); + MEM_write_1_byte(MEMADD_DRIVE_STOP_TIME, KART_CST.DRIVE_STOP_TIME); + MEM_write_1_byte(MEMADD_DRIVE_ALIVE_TIME, KART_CST.DRIVE_ALIVE_TIME); - MEM_write_1_byte(MEMADD_STEERING_ALIVE_TIME, CAR_CST.STEERING_ALIVE_TIME); + MEM_write_1_byte(MEMADD_STEERING_ALIVE_TIME, KART_CST.STEERING_ALIVE_TIME); - MEM_write_1_byte(MEMADD_BATTERY_VOLT_TIME, CAR_CST.BATTERY_VOLT_TIME); - MEM_write_1_byte(MEMADD_BATTERY_CURRENT_TIME, CAR_CST.BATTERY_CURRENT_TIME); - MEM_write_1_byte(MEMADD_BATTERY_ENERGY_TIME, CAR_CST.BATTERY_ENERGY_TIME); - MEM_write_1_byte(MEMADD_BATTERY_ALIVE_TIME, CAR_CST.BATTERY_ALIVE_TIME); + MEM_write_1_byte(MEMADD_BATTERY_VOLT_TIME, KART_CST.BATTERY_VOLT_TIME); + MEM_write_1_byte(MEMADD_BATTERY_CURRENT_TIME, KART_CST.BATTERY_CURRENT_TIME); + MEM_write_1_byte(MEMADD_BATTERY_ENERGY_TIME, KART_CST.BATTERY_ENERGY_TIME); + MEM_write_1_byte(MEMADD_BATTERY_ALIVE_TIME, KART_CST.BATTERY_ALIVE_TIME); MEM_write_1_byte(0x0, 0x42); } else { - CAR_CST.CONTROL_STEERING_MODE = MEM_read_1_byte(MEMADD_CONTROL_STEERING_MODE); - CAR_CST.CONTROL_ALIVE_TIME = MEM_read_1_byte(MEMADD_CONTROL_ALIVE_TIME); - CAR_CST.CONTROL_SPEED_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_SPEED_FACTOR); - CAR_CST.CONTROL_POWER_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_POWER_FACTOR); - CAR_CST.CONTROL_STEERING_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_STEERING_FACTOR); - CAR_CST.CONTROL_MAX_SPEED_FW = MEM_read_1_byte(MEMADD_CONTROL_MAX_SPEED_FW); - CAR_CST.CONTROL_MAX_SPEED_BW = MEM_read_1_byte(MEMADD_CONTROL_MAX_SPEED_BW); + KART_CST.CONTROL_STEERING_MODE = MEM_read_1_byte(MEMADD_CONTROL_STEERING_MODE); + KART_CST.CONTROL_ALIVE_TIME = MEM_read_1_byte(MEMADD_CONTROL_ALIVE_TIME); + KART_CST.CONTROL_SPEED_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_SPEED_FACTOR); + KART_CST.CONTROL_POWER_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_POWER_FACTOR); + KART_CST.CONTROL_STEERING_FACTOR = MEM_read_1_byte(MEMADD_CONTROL_STEERING_FACTOR); + KART_CST.CONTROL_MAX_SPEED_FW = MEM_read_1_byte(MEMADD_CONTROL_MAX_SPEED_FW); + KART_CST.CONTROL_MAX_SPEED_BW = MEM_read_1_byte(MEMADD_CONTROL_MAX_SPEED_BW); - CAR_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE); - CAR_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1); - CAR_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2); - CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); + KART_CST.JOYSTICK_MODE = MEM_read_1_byte(MEMADD_JOYSTICK_MODE); + KART_CST.JOYSTICK_PARAM1 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM1); + KART_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2); + KART_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); - CAR_CST.DISPLAY_ALIVE_TIME = MEM_read_1_byte(MEMADD_DISPLAY_ALIVE_TIME); + KART_CST.DISPLAY_ALIVE_TIME = MEM_read_1_byte(MEMADD_DISPLAY_ALIVE_TIME); - CAR_CST.DRIVE_SPEED_TIME = MEM_read_1_byte(MEMADD_DRIVE_SPEED_TIME); - CAR_CST.DRIVE_STOP_TIME = MEM_read_1_byte(MEMADD_DRIVE_STOP_TIME); - CAR_CST.DRIVE_ALIVE_TIME = MEM_read_1_byte(MEMADD_DRIVE_ALIVE_TIME); + KART_CST.DRIVE_SPEED_TIME = MEM_read_1_byte(MEMADD_DRIVE_SPEED_TIME); + KART_CST.DRIVE_STOP_TIME = MEM_read_1_byte(MEMADD_DRIVE_STOP_TIME); + KART_CST.DRIVE_ALIVE_TIME = MEM_read_1_byte(MEMADD_DRIVE_ALIVE_TIME); - CAR_CST.STEERING_ALIVE_TIME = MEM_read_1_byte(MEMADD_STEERING_ALIVE_TIME); + KART_CST.STEERING_ALIVE_TIME = MEM_read_1_byte(MEMADD_STEERING_ALIVE_TIME); - CAR_CST.BATTERY_VOLT_TIME = MEM_read_1_byte(MEMADD_BATTERY_VOLT_TIME); - CAR_CST.BATTERY_CURRENT_TIME = MEM_read_1_byte(MEMADD_BATTERY_CURRENT_TIME); - CAR_CST.BATTERY_ENERGY_TIME = MEM_read_1_byte(MEMADD_BATTERY_ENERGY_TIME); - CAR_CST.BATTERY_ALIVE_TIME = MEM_read_1_byte(MEMADD_BATTERY_ALIVE_TIME); + KART_CST.BATTERY_VOLT_TIME = MEM_read_1_byte(MEMADD_BATTERY_VOLT_TIME); + KART_CST.BATTERY_CURRENT_TIME = MEM_read_1_byte(MEMADD_BATTERY_CURRENT_TIME); + KART_CST.BATTERY_ENERGY_TIME = MEM_read_1_byte(MEMADD_BATTERY_ENERGY_TIME); + KART_CST.BATTERY_ALIVE_TIME = MEM_read_1_byte(MEMADD_BATTERY_ALIVE_TIME); } } diff --git a/busmaster_config.cfx b/busmaster_config.cfx index 94c32ac..783a951 100644 --- a/busmaster_config.cfx +++ b/busmaster_config.cfx @@ -8,8 +8,8 @@ FALSE FALSE FALSE - FALSE - TRUE + TRUE + FALSE SYSTEM FALSE FALSE @@ -17,7 +17,7 @@ FALSE SHOWNORMAL - HIDE + SHOWNORMAL 655 0 874 @@ -28,6 +28,44 @@ threewheeler.DBF + + + + Parameter + 1 + 200 + 1 + + + Channel 1 + 2 + 90 + 1 + + + + + Parameter + 1 + 200 + 1 + + + Channel 1 + 2 + 90 + 1 + + + + SHOWNORMAL + RESTORETOMAXIMIZED + 388 + 612 + 1002 + 1034 + + MHS Tiny-CAN @@ -85,27 +123,305 @@ + + + notAlive + STOP + + 271 + 271 + Rx + STD + NONRTR + 0 + + + 799 + 799 + ALL + STD + ALL + 0 + + + 543 + 543 + ALL + STD + ALL + 0 + + + 1055 + 1055 + ALL + STD + ALL + 0 + + + 1311 + 1311 + ALL + STD + ALL + 0 + + + + display + PASS + + 306 + 306 + ALL + STD + ALL + 0 + + + 307 + 307 + ALL + ALL + ALL + 0 + + + 799 + 799 + ALL + ALL + ALL + 0 + + + 1585 + 1585 + ALL + ALL + ALL + 0 + + + 1586 + 1586 + ALL + ALL + ALL + 0 + + + 1587 + 1587 + ALL + ALL + ALL + 0 + + + + drive + PASS + + 320 + 320 + ALL + ALL + ALL + 0 + + + 321 + 321 + ALL + ALL + ALL + 0 + + + 1055 + 1055 + ALL + ALL + ALL + 0 + + + 1040 + 1040 + ALL + ALL + ALL + 0 + + + + steering + PASS + + 336 + 336 + ALL + ALL + ALL + 0 + + + 337 + 337 + ALL + ALL + ALL + 0 + + + 1298 + 1298 + ALL + ALL + ALL + 0 + + + 1311 + 1311 + ALL + ALL + ALL + 0 + + + 82 + 82 + ALL + ALL + ALL + 0 + + + + joy + PASS + + 288 + 288 + ALL + ALL + ALL + 0 + + + 529 + 529 + ALL + ALL + ALL + 0 + + + 543 + 543 + ALL + ALL + ALL + 0 + + + + controller + PASS + + 16 + 16 + ALL + ALL + ALL + 0 + + + 271 + 271 + ALL + ALL + ALL + 0 + + + 17 + 17 + ALL + ALL + ALL + 0 + + + 18 + 18 + ALL + ALL + ALL + 0 + + + 19 + 19 + ALL + ALL + ALL + 0 + + + 20 + 20 + ALL + ALL + ALL + 0 + + + 22 + 22 + ALL + ALL + ALL + 0 + + + - 288 - DeltaY - aliveTime - timeMeasureOrDeltaX - mode + 337 + SteeringPosition + + + 336 + SET_CENTER + HOMING + RESET + ALIVE_TIME + + + 82 + CENTER_POS + + + 1298 + POSITION SHOWNORMAL HIDE - 622 - 86 - 816 - 998 + 157 + 596 + 1086 + 387 - 142 - 174 - 285 - 142 + 94 + 178 + 189 + 94 @@ -192,12 +508,12 @@ - HIDE + SHOWNORMAL RESTORETOMAXIMIZED 0 0 - 0 - 0 + 577 + 423 @@ -212,9 +528,11 @@ - 5000 - 2000 - 100 + 2025155376 + 24800128 + 2025155348 + notAlive + steering 1 @@ -223,27 +541,27 @@ Time - 2 + 5 1 - 138 + 129 Tx/Rx - 3 + 4 1 - 85 + 53 Channel - 4 - 1 - 92 + 2 + 0 + 0 Msg Type - 5 - 1 - 71 + 3 + 0 + 0 ID @@ -255,22 +573,22 @@ Message 7 1 - 174 + 143 DLC 8 1 - 75 + 38 Data Byte(s) 9 1 - 198 + 158 1 - 0 + 1 0 SYSTEM @@ -278,16 +596,16 @@ RESTORETOMAXIMIZED 0 0 - 295 - 909 + 810 + 606 SHOWNORMAL RESTORETOMAXIMIZED - 271 - 879 - 958 - 1552 + 173 + 10 + 451 + 359 @@ -378,15 +696,15 @@ RESTORETOMAXIMIZED 0 0 - 543 + 549 1614 SHOWNORMAL RESTORETOMAXIMIZED - 179 + 173 10 - 457 + 451 359 @@ -463,15 +781,15 @@ RESTORETOMAXIMIZED 0 0 - 543 + 549 1614 SHOWNORMAL RESTORETOMAXIMIZED - 179 + 173 10 - 457 + 451 359 @@ -479,19 +797,19 @@ SHOWNORMAL SETMINPOSITION - 12 - 989 - 667 - 1849 + 3 + 1055 + 658 + 1915 1 - 528 + 22 FALSE FALSE 4 - 0,0,0,0 + 0,5,1,25 10 FALSE a @@ -499,11 +817,11 @@ 1 - 529 + 16 FALSE FALSE 4 - 0,0,0,0 + 0,0,0,50 10 FALSE a @@ -511,11 +829,11 @@ 1 - 288 + 306 FALSE FALSE - 4 - 0,255,1,5 + 2 + 0,100 10 FALSE a @@ -523,11 +841,35 @@ 1 - 543 + 336 FALSE FALSE - 1 - 0 + 4 + 1,0,0,0 + 10 + FALSE + a + FALSE + + + 1 + 336 + FALSE + FALSE + 4 + 0,1,0,0 + 10 + FALSE + a + FALSE + + + 1 + 337 + FALSE + FALSE + 4 + 0,1,134,160 10 FALSE a From 00130b03eea524dcd585776147860437f18fc0ba Mon Sep 17 00:00:00 2001 From: Klagarge Date: Wed, 30 Aug 2023 20:22:44 +0200 Subject: [PATCH 29/50] add blinker --- .../app/factory/factory.c | 12 ++ .../app/factory/factory.h | 5 + .../middleware/blinker.c | 189 ++++++++++++++++++ .../middleware/blinker.h | 167 ++++++++++++++++ .../nbproject/configurations.xml | 3 + 5 files changed, 376 insertions(+) create mode 100644 306-controller_interface.X/middleware/blinker.c create mode 100644 306-controller_interface.X/middleware/blinker.h diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index 2964f29..c3d018b 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -30,6 +30,10 @@ LED* l8() { return &theFactory.l8_; } +BLINKER* b1() { + return &theFactory.b1_; +} + ALIVE* ALcontroller(){ return &theFactory.ALcontroller_; } @@ -58,6 +62,8 @@ void Factory_init() { LED_initHW(l6()); LED_initHW(l7()); LED_initHW(l8()); + + BLINKER_init(b1()); CAN_init(); CAN_setSender(1); @@ -78,6 +84,9 @@ void Factory_build() { ALIVE_onAlive(ALcontroller(), CM_CONTROLLER_ALIVE, NULL); + BLINKER_onOn(b1(), LED_on, l6()); + BLINKER_onOff(b1(), LED_off, l6()); + ALIVE_onSetup(ALjoy(), CM_JOY_SETUP, NULL); ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME); ALIVE_onBorn(ALjoy(), LED_on, l1()); @@ -88,6 +97,9 @@ void Factory_build() { //start all state machines void Factory_start() { CAN_startBehaviour(); + + BLINKER_startBehaviour(b1()); + BLINKER_emitBlink(b1(), 0); ALIVE_startBehaviourSender(ALcontroller()); ALIVE_startBehaviourChecker(ALjoy()); diff --git a/306-controller_interface.X/app/factory/factory.h b/306-controller_interface.X/app/factory/factory.h index bcbc830..9835497 100644 --- a/306-controller_interface.X/app/factory/factory.h +++ b/306-controller_interface.X/app/factory/factory.h @@ -19,6 +19,7 @@ #include "../../middleware/alive.h" #include "../../middleware/can_interface.h" #include "../../middleware/eeprom.h" +#include "../../middleware/blinker.h" typedef struct { @@ -31,6 +32,8 @@ typedef struct { LED l7_; LED l8_; + BLINKER b1_; + ALIVE ALcontroller_; ALIVE ALjoy_; @@ -51,6 +54,8 @@ LED* l6(); LED* l7(); LED* l8(); +BLINKER* b1(); + ALIVE* ALcontroller(); ALIVE* ALjoy(); diff --git a/306-controller_interface.X/middleware/blinker.c b/306-controller_interface.X/middleware/blinker.c new file mode 100644 index 0000000..f8a948f --- /dev/null +++ b/306-controller_interface.X/middleware/blinker.c @@ -0,0 +1,189 @@ +/** + * @author Rémi Heredero + * @version 1.0.0 + * @date July 2023 + * @file blinker.c + */ + +#include "blinker.h" + +void BLINKER_init(BLINKER* me){ + me->state = STBL_INIT; + me->timeOn = 500; + me->timeOff = 500; + me->numberOfBlink = 3; + me->nBlinkIsOn = false; + me->remainBlinks = 3; + me->wait.f = NULL; + me->on.f = NULL; + me->off.f = NULL; + me->finished.f = NULL; +} + +void BLINKER_startBehaviour(BLINKER* me) { + POST(me, &BLINKER_processEvent, evBLinit, 0, 0); +} + +bool BLINKER_processEvent(Event* ev) { + bool processed = false; + BLINKER* me = (BLINKER*)Event_getTarget(ev); + BLINKER_STATES oldState = me->state; + evIDT evid = Event_getId(ev); + + switch (me->state) { // onState + case STBL_INIT: + if (ev->id == evBLinit) { + me->state = STBL_WAIT; + } + break; + + case STBL_WAIT: + me->remainBlinks = me->numberOfBlink; + if(evid == evBLblinkN) { + me->state = STBL_ON; + me->nBlinkIsOn = true; + BLINKER_emitTimer(me, me->timeOn); + } + if(evid == evBLblink) { + me->state = STBL_ON; + me->nBlinkIsOn = false; + BLINKER_emitTimer(me, me->timeOn); + } + break; + + case STBL_ON: + if (me->nBlinkIsOn) { + me->remainBlinks--; + } + if (evid == evBLtimer) { + me->state = STBL_OFF; + BLINKER_emitTimer(me, me->timeOff); + } + break; + + case STBL_OFF: + if (evid == evBLtimer) { + if (me->remainBlinks == 0) { + me->state = STBL_WAIT; + if (me->finished.f != NULL) { + me->finished.f(me->finished.p); + } + } else { + me->state = STBL_ON; + BLINKER_emitTimer(me, me->timeOn); + } + } + break; + } + + if(oldState != me->state){ + switch (oldState) { // onExit + case STBL_INIT: + break; + + case STBL_WAIT: + break; + + case STBL_ON: + break; + + case STBL_OFF: + break; + } + + switch (me->state) { // onEntry + case STBL_INIT: + break; + + case STBL_WAIT: + if (me->wait.f != NULL) { + me->wait.f(me->wait.p); + } + break; + + case STBL_ON: + if (me->on.f != NULL) { + me->on.f(me->on.p); + } + break; + + case STBL_OFF: + if (me->off.f != NULL) { + me->off.f(me->off.p); + } + break; + } + + processed = true; + } + return processed; +} + +/************* + * Callbacks * + *************/ + +void BLINKER_onWait(BLINKER* me, BLINKER_CALLBACK_FUNCTION f, void* p) { + me->wait.f = f; + me->wait.p = p; +} + +void BLINKER_onOn(BLINKER* me, BLINKER_CALLBACK_FUNCTION f, void* p) { + me->on.f = f; + me->on.p = p; +} + +void BLINKER_onOff(BLINKER* me, BLINKER_CALLBACK_FUNCTION f, void* p) { + me->off.f = f; + me->off.p = p; +} + +void BLINKER_onFinished(BLINKER* me, BLINKER_CALLBACK_FUNCTION f, void* p) { + me->finished.f = f; + me->finished.p = p; +} + +/************ + * EMITTERS * + ************/ + +void BLINKER_emitBlink(BLINKER* me, uint16_t t) { + POST(me, &BLINKER_processEvent, evBLblink, t, 0); +} + +void BLINKER_emitBlinkN(BLINKER* me, uint16_t t) { + POST(me, &BLINKER_processEvent, evBLblinkN, t, 0); +} + +void BLINKER_emitTimer(BLINKER* me, uint16_t t) { + POST(me, &BLINKER_processEvent, evBLtimer, t, 0); +} + +/*********** + * SETTERS * + ***********/ + +void BLINKER_setTimeOn(BLINKER* me, uint16_t v) { + me->timeOn = v; +} + +void BLINKER_setTimeOff(BLINKER* me, uint16_t v) { + me->timeOff = v; +} + +void BLINKER_setNumberOfBlink(BLINKER* me, uint8_t v) { + me->numberOfBlink = v; +} + +void BLINKER_setNBlinkIsOn(BLINKER* me, bool v) { + me->nBlinkIsOn = v; +} + +void BLINKER_setRemainBlinks(BLINKER* me, uint8_t v) { + me->remainBlinks = v; +} + + +void BLINKER_endBlink(BLINKER* me) { + me->remainBlinks = 0; +} diff --git a/306-controller_interface.X/middleware/blinker.h b/306-controller_interface.X/middleware/blinker.h new file mode 100644 index 0000000..4b2366e --- /dev/null +++ b/306-controller_interface.X/middleware/blinker.h @@ -0,0 +1,167 @@ +/** + * @author Rémi Heredero + * @version 1.0.0 + * @date July 2023 + * @file blinker.h + */ +#ifndef BLINKER_H +#define BLINKER_H + +#include "../xf/xf.h" + +typedef enum { + STBL_INIT, + STBL_WAIT, + STBL_ON, + STBL_OFF +} BLINKER_STATES; + +typedef enum { + evBLinit = 200, + evBLblink, + evBLblinkN, + evBLtimer +} BLINKER_EVENTS; + +typedef void (*BLINKER_CALLBACK_FUNCTION)(void*); +typedef struct { + BLINKER_CALLBACK_FUNCTION f; // function + void* p; // param(s) +} BLINKER_CALLBACK; + +typedef struct { + BLINKER_STATES state; //Actual state + uint16_t timeOn; // Time on + uint16_t timeOff; // Time off + uint8_t numberOfBlink; // Number of blink for this blinker when start with blinkN + bool nBlinkIsOn; // If the nBlink way is enable + uint8_t remainBlinks; // Actual remain blink + BLINKER_CALLBACK wait; + BLINKER_CALLBACK on; + BLINKER_CALLBACK off; + BLINKER_CALLBACK finished; +} BLINKER; + +/** + * Initialize the BLINKER + * @param me the BLINKER itself + */ +void BLINKER_init(BLINKER* me); + +/** + * Start the BLINKER state machine + * @param me the BLINKER itself + */ +void BLINKER_startBehaviour(BLINKER* me); + +/** + * Process the event + * @param ev the event to process + * @return true if the event is processed + */ +bool BLINKER_processEvent(Event* ev); + +/************* + * Callbacks * + *************/ + +/** + * Set the callback function to call when the BLINKER is entering state wait + * @param me the BLINKER itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void BLINKER_onWait(BLINKER* me, BLINKER_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the BLINKER is entering state on + * @param me the BLINKER itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void BLINKER_onOn(BLINKER* me, BLINKER_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the BLINKER is entering state off + * @param me the BLINKER itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void BLINKER_onOff(BLINKER* me, BLINKER_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callabck function to call when the BLINKER is entering state finished + * @param me the BLINKER itself + * @param f the function to call + * @param t the param(s) to pass to the function + */ +void BLINKER_onFinished(BLINKER* me, BLINKER_CALLBACK_FUNCTION f, void* p); + +/************ + * EMITTERS * + ************/ + +/** + * Emit the blink event + * @param me the BLINKER itself + * @param t time to wait in ms before triggering event + */void BLINKER_emitBlink(BLINKER* me, uint16_t t); + +/** + * Emit the blinkn event + * @param me the BLINKER itself + * @param t time to wait in ms before triggering event + */void BLINKER_emitBlinkN(BLINKER* me, uint16_t t); + +/** + * Emit the timer event + * @param me the BLINKER itself + * @param t time to wait in ms before triggering event + */void BLINKER_emitTimer(BLINKER* me, uint16_t t); + +/*********** + * SETTERS * + ***********/ + +/** + * Set the time on + * @param me the BLINKER itself + * @param v the value to set + */ +void BLINKER_setTimeOn(BLINKER* me, uint16_t v); + +/** + * Set the time off + * @param me the BLINKER itself + * @param v the value to set + */ +void BLINKER_setTimeOff(BLINKER* me, uint16_t v); + +/** + * Set the number of blink + * @param me the BLINKER itself + * @param v the value to set + */ +void BLINKER_setNumberOfBlink(BLINKER* me, uint8_t v); + +/** + * Set the nBlinkIsOn + * @param me the BLINKER itself + * @param v the value to set + */ +void BLINKER_setNBlinkIsOn(BLINKER* me, bool v); + +/** + * Set the remain blink(s) + * @param me the BLINKER itself + * @param v the value to set + */ +void BLINKER_setRemainBlinks(BLINKER* me, uint8_t v); + +/** + * Stop to blink if it was indefinitely blinking + * @param me the blinker itself + */ +void BLINKER_endBlink(BLINKER* me); + +#endif diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 28707ef..c01e68d 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -27,6 +27,7 @@ middleware/can_interface.h middleware/alive.h + middleware/blinker.h xf/event.h @@ -63,6 +64,7 @@ middleware/can_interface.c middleware/alive.c + middleware/blinker.c xf/event.c @@ -214,6 +216,7 @@ + From dc6e4ec65a094b77bab6af76276e3bd363d192e1 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 31 Aug 2023 13:42:31 +0200 Subject: [PATCH 30/50] add kartculator --- 306-controller_interface.X/app/can_message.c | 39 ++- 306-controller_interface.X/app/can_message.h | 4 + 306-controller_interface.X/app/car.h | 7 +- 306-controller_interface.X/app/kartculator.c | 39 +++ 306-controller_interface.X/app/kartculator.h | 24 ++ .../middleware/eeprom.c | 12 +- .../nbproject/configurations.xml | 2 + busmaster_config.cfx | 318 +++++++++--------- 8 files changed, 267 insertions(+), 178 deletions(-) create mode 100644 306-controller_interface.X/app/kartculator.c create mode 100644 306-controller_interface.X/app/kartculator.h diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 3fa19b1..2075c90 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -9,6 +9,7 @@ #include "car.h" #include "../app/factory/factory.h" #include "../middleware/can_interface.h" +#include "kartculator.h" typedef union { struct { @@ -20,6 +21,14 @@ typedef union { uint32_t full; } BYTES_4; +typedef union { + struct { + uint8_t byte0; + uint8_t byte1; + } separate; + uint16_t full; +} BYTES_2; + void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ switch(idSender){ @@ -145,6 +154,11 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 2: if(idMsg == 0x1) { // JOY_MESURE // posX posY button - + BYTES_4 tmpData; + tmpData.full = data; + + calcTorque(tmpData.separate.byte1); + calcPosition(tmpData.separate.byte0); } @@ -182,7 +196,14 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 4: if(idMsg == 0x0) { // DRIVE_SPEED // speedHH speedH speedL speedLL - + BYTES_4 tmpData; + tmpData.full = data; + BYTES_4 rpm; + rpm.separate.byte0 = tmpData.separate.byte3; + rpm.separate.byte1 = tmpData.separate.byte2; + rpm.separate.byte2 = tmpData.separate.byte1; + rpm.separate.byte3 = tmpData.separate.byte0; + calcSpeed(rpm.full); } if(idMsg == 0xF) { // DRIVE_ALIVE @@ -199,7 +220,14 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 5: if(idMsg == 0x1) { // STEERING_GET_CENTER // valHH valH valL valLL - + BYTES_4 tmpData; + tmpData.full = data; + BYTES_4 center; + center.separate.byte0 = tmpData.separate.byte3; + center.separate.byte1 = tmpData.separate.byte2; + center.separate.byte2 = tmpData.separate.byte1; + center.separate.byte3 = tmpData.separate.byte0; + eKart.center = center.full; } if(idMsg == 0x2) { // STEERING_GET_POSITION @@ -291,7 +319,12 @@ void CM_DRIVE_SETUP(void* p) { void CM_DRIVE_POWER(void* p) { // valH valL - - - // TODO + BYTES_2 torque; + BYTES_4 tmpData; + torque.full = *((int16_t*) p); + tmpData.separate.byte0 = torque.separate.byte1; + tmpData.separate.byte1 = torque.separate.byte0; + CAN_Send(4, 1, tmpData.full); } void CM_STEERING_SETUP(void* p) { diff --git a/306-controller_interface.X/app/can_message.h b/306-controller_interface.X/app/can_message.h index 64bab11..0249c07 100644 --- a/306-controller_interface.X/app/can_message.h +++ b/306-controller_interface.X/app/can_message.h @@ -75,6 +75,10 @@ void CM_DISPLAY_DIRECTION(void* p); */ void CM_DRIVE_SETUP(void* p); +/** + * Send power to the drive + * @param p the torque (int16_t*) + */ void CM_DRIVE_POWER(void* p); /** diff --git a/306-controller_interface.X/app/car.h b/306-controller_interface.X/app/car.h index 5551386..dfea2a5 100644 --- a/306-controller_interface.X/app/car.h +++ b/306-controller_interface.X/app/car.h @@ -69,9 +69,10 @@ typedef struct { KART_CST_TYPE KART_CST; typedef struct { - int32_t speed; - uint32_t center; - uint32_t position; + int16_t torque; // + uint32_t center; // + uint32_t position; // + uint8_t speed; // 100m/h } KART_VAR_TYPE; KART_VAR_TYPE eKart; diff --git a/306-controller_interface.X/app/kartculator.c b/306-controller_interface.X/app/kartculator.c new file mode 100644 index 0000000..deeecae --- /dev/null +++ b/306-controller_interface.X/app/kartculator.c @@ -0,0 +1,39 @@ +/** + * @author Rémi Heredero + * @version. 0.0.0 + * @date August 2023 + * @file kartculator.c + */ + +#include "kartculator.h" + +void calcTorque(uint8_t joy_pos) { + int32_t calcTorque; + calcTorque = joy_pos; // joystick position + calcTorque *= KART_CST.CONTROL_POWER_FACTOR; // convert by power factor + calcTorque /= 1000; // torque define by joystick + eKart.torque = (int16_t) calcTorque; +} + +void calcPosition(uint8_t joy_pos){ + int32_t calcPosition; + calcPosition = joy_pos; +} + +void calcSpeed(int32_t rpm) { + +} + +int16_t getTorque() { + +} + +uint32_t getPosition() { + +} + +uint8_t getSpeed() { + +} + + diff --git a/306-controller_interface.X/app/kartculator.h b/306-controller_interface.X/app/kartculator.h new file mode 100644 index 0000000..a2ce5cb --- /dev/null +++ b/306-controller_interface.X/app/kartculator.h @@ -0,0 +1,24 @@ +/** + * @author Rémi Heredero + * @version. 0.0.0 + * @date August 2023 + * @file kartculator.h + */ + +#ifndef KARTCULATOR_H +#define KARTCULATOR_H + +#include // usage of standard types +#include // usage of boolean types +#include "../mcc_generated_files/mcc.h" +#include "car.h" + +void calcTorque(uint8_t joy_pos); +void calcPosition(uint8_t joy_pos); +void calcSpeed(int32_t rpm); +int16_t getTorque(); +uint32_t getPosition(); +uint8_t getSpeed(); + +#endif /* KARTCULATOR_H */ + diff --git a/306-controller_interface.X/middleware/eeprom.c b/306-controller_interface.X/middleware/eeprom.c index 6be123a..874f425 100644 --- a/306-controller_interface.X/middleware/eeprom.c +++ b/306-controller_interface.X/middleware/eeprom.c @@ -25,10 +25,10 @@ void MEM_init(){ KART_CST.CONTROL_STEERING_MODE = 0; KART_CST.CONTROL_ALIVE_TIME = 50; KART_CST.CONTROL_SPEED_FACTOR = 0; - KART_CST.CONTROL_POWER_FACTOR = 0; - KART_CST.CONTROL_STEERING_FACTOR = 0; - KART_CST.CONTROL_MAX_SPEED_FW = 0; - KART_CST.CONTROL_MAX_SPEED_BW = 0; + KART_CST.CONTROL_POWER_FACTOR = 10000; + KART_CST.CONTROL_STEERING_FACTOR = 400000000; + KART_CST.CONTROL_MAX_SPEED_FW = 500; + KART_CST.CONTROL_MAX_SPEED_BW = 250; KART_CST.JOYSTICK_MODE = 0; KART_CST.JOYSTICK_PARAM1 = 5; @@ -37,8 +37,8 @@ void MEM_init(){ KART_CST.DISPLAY_ALIVE_TIME = 100; - KART_CST.DRIVE_SPEED_TIME = 0; - KART_CST.DRIVE_STOP_TIME = 0; + KART_CST.DRIVE_SPEED_TIME = 5; + KART_CST.DRIVE_STOP_TIME = 20; KART_CST.DRIVE_ALIVE_TIME = 10; KART_CST.STEERING_ALIVE_TIME = 100; diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index c01e68d..70c7382 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -9,6 +9,7 @@ app/car.h app/can_message.h middleware/eeprom.h + app/kartculator.h board/led/led.h @@ -46,6 +47,7 @@ app/factory/factory.c app/can_message.c middleware/eeprom.c + app/kartculator.c board/led/led.c diff --git a/busmaster_config.cfx b/busmaster_config.cfx index 783a951..67531f2 100644 --- a/busmaster_config.cfx +++ b/busmaster_config.cfx @@ -2,7 +2,7 @@ 3.2.2 - FALSE + TRUE FALSE FALSE FALSE @@ -17,7 +17,7 @@ FALSE SHOWNORMAL - SHOWNORMAL + HIDE 655 0 874 @@ -42,21 +42,21 @@ 90 1 + + + Parameter + 1 + 200 + 1 + + + Channel 1 + 2 + 90 + 1 + + - - - Parameter - 1 - 200 - 1 - - - Channel 1 - 2 - 90 - 1 - - SHOWNORMAL RESTORETOMAXIMIZED @@ -69,7 +69,7 @@ MHS Tiny-CAN - Bus Off + Unknown 250 @@ -125,21 +125,13 @@ - notAlive + noAlive STOP 271 271 - Rx - STD - NONRTR - 0 - - - 799 - 799 ALL - STD + ALL ALL 0 @@ -147,42 +139,6 @@ 543 543 ALL - STD - ALL - 0 - - - 1055 - 1055 - ALL - STD - ALL - 0 - - - 1311 - 1311 - ALL - STD - ALL - 0 - - - - display - PASS - - 306 - 306 - ALL - STD - ALL - 0 - - - 307 - 307 - ALL ALL ALL 0 @@ -196,24 +152,16 @@ 0 - 1585 - 1585 + 1055 + 1055 ALL ALL ALL 0 - 1586 - 1586 - ALL - ALL - ALL - 0 - - - 1587 - 1587 + 1311 + 1311 ALL ALL ALL @@ -240,16 +188,16 @@ 0 - 1055 - 1055 + 1040 + 1040 ALL ALL ALL 0 - 1040 - 1040 + 1055 + 1055 ALL ALL ALL @@ -300,6 +248,66 @@ 0 + + display + PASS + + 306 + 306 + ALL + ALL + ALL + 0 + + + 307 + 307 + ALL + ALL + ALL + 0 + + + 48 + 48 + ALL + ALL + ALL + 0 + + + 799 + 799 + ALL + ALL + ALL + 0 + + + 1585 + 1585 + ALL + ALL + ALL + 0 + + + 1586 + 1586 + ALL + ALL + ALL + 0 + + + 1587 + 1587 + ALL + ALL + ALL + 0 + + joy PASS @@ -328,78 +336,29 @@ 0 - - controller - PASS - - 16 - 16 - ALL - ALL - ALL - 0 - - - 271 - 271 - ALL - ALL - ALL - 0 - - - 17 - 17 - ALL - ALL - ALL - 0 - - - 18 - 18 - ALL - ALL - ALL - 0 - - - 19 - 19 - ALL - ALL - ALL - 0 - - - 20 - 20 - ALL - ALL - ALL - 0 - - - 22 - 22 - ALL - ALL - ALL - 0 - - - 337 - SteeringPosition + 1040 + Speed + + + 321 + Power + + + 320 + resetInit + speedTime + stopTime + aliveTime 336 - SET_CENTER - HOMING RESET ALIVE_TIME + SET_CENTER + HOMING 82 @@ -412,14 +371,14 @@ SHOWNORMAL HIDE - 157 - 596 - 1086 - 387 + 150 + 608 + 1098 + 437 94 - 178 + 94 189 94 @@ -434,10 +393,10 @@ 300 - 87 - 87 - 174 - 87 + 94 + 94 + 189 + 94 @@ -450,10 +409,10 @@ 300 - 87 - 87 - 174 - 87 + 94 + 94 + 189 + 94 @@ -528,10 +487,13 @@ - 2025155376 - 24800128 - 2025155348 - notAlive + 1489464112 + 23901712 + 1489464084 + display + drive + joy + noAlive steering @@ -593,7 +555,7 @@ SYSTEM SHOWNORMAL - RESTORETOMAXIMIZED + SETMINPOSITION 0 0 810 @@ -688,12 +650,12 @@ 720 1 - 0 + 1 0 SYSTEM SHOWNORMAL - RESTORETOMAXIMIZED + SETMINPOSITION 0 0 549 @@ -773,12 +735,12 @@ 734 1 - 0 + 1 0 SYSTEM SHOWNORMAL - RESTORETOMAXIMIZED + SETMINPOSITION 0 0 549 @@ -821,7 +783,7 @@ FALSE FALSE 4 - 0,0,0,50 + 0,1,0,50 10 FALSE a @@ -875,6 +837,30 @@ a FALSE + + 1 + 321 + FALSE + FALSE + 2 + 0,0 + 10 + FALSE + a + FALSE + + + 1 + 320 + FALSE + FALSE + 4 + 1,25,0,0 + 10 + FALSE + a + FALSE + From d31544783c293b9b8ce7fdcc256f3ddf4f83eb0b Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 31 Aug 2023 17:02:23 +0200 Subject: [PATCH 31/50] test drive --- 306-controller_interface.X/app/can_message.c | 11 ++++++ .../app/factory/factory.c | 39 +++++++++++++++++-- .../app/factory/factory.h | 2 + .../middleware/eeprom.c | 8 ++-- 4 files changed, 52 insertions(+), 8 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 2075c90..763192a 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -208,6 +208,15 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0xF) { // DRIVE_ALIVE // statusH statusL - - + ALIVE_ISALIVE(ALdrive()); + if(ALdrive()->state == STAL_DEAD){ + KART_CST.DRIVE_SPEED_TIME = MEM_read_1_byte(MEMADD_DRIVE_SPEED_TIME); + KART_CST.DRIVE_STOP_TIME = MEM_read_1_byte(MEMADD_DRIVE_STOP_TIME); + KART_CST.DRIVE_ALIVE_TIME = MEM_read_1_byte(MEMADD_DRIVE_ALIVE_TIME); + ALIVE_setAliveTime(ALdrive(), KART_CST.DRIVE_ALIVE_TIME); + ALIVE_emitBorn(ALdrive(), 0, 0); + ALIVE_emitReady(ALdrive(), 100, 0); + } // TODO drive say ALIVE } @@ -324,6 +333,8 @@ void CM_DRIVE_POWER(void* p) { torque.full = *((int16_t*) p); tmpData.separate.byte0 = torque.separate.byte1; tmpData.separate.byte1 = torque.separate.byte0; + tmpData.separate.byte2 = 0; + tmpData.separate.byte3 = 0; CAN_Send(4, 1, tmpData.full); } diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index c3d018b..a2905fa 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -42,6 +42,10 @@ ALIVE* ALjoy(){ return &theFactory.ALjoy_; } +ALIVE* ALdrive(){ + return &theFactory.ALdrive_; +} + //initialize all objects void Factory_init() { @@ -75,6 +79,20 @@ void Factory_init() { ALIVE_setAliveTime(ALcontroller(), KART_CST.CONTROL_ALIVE_TIME); ALIVE_init(ALjoy()); + ALIVE_init(ALdrive()); +} + +void foo(void* p){ + static int16_t speed = 0; + static bool up = true; + if(up) { + speed += 3; + if(speed >100) up = false; + } else { + speed -= 3; + if(speed < -100) up = true; + } + CM_DRIVE_POWER(&speed); } //connect objects if required @@ -84,26 +102,39 @@ void Factory_build() { ALIVE_onAlive(ALcontroller(), CM_CONTROLLER_ALIVE, NULL); - BLINKER_onOn(b1(), LED_on, l6()); - BLINKER_onOff(b1(), LED_off, l6()); + //BLINKER_onOn(b1(), LED_on, l6()); + //BLINKER_onOff(b1(), LED_off, l6()); ALIVE_onSetup(ALjoy(), CM_JOY_SETUP, NULL); ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME); ALIVE_onBorn(ALjoy(), LED_on, l1()); ALIVE_onDead(ALjoy(), LED_off, l1()); + ALIVE_onSetup(ALdrive(), CM_DRIVE_SETUP, NULL); + ALIVE_setAliveTime(ALdrive(), KART_CST.DRIVE_ALIVE_TIME); + ALIVE_onBorn(ALdrive(), LED_on, l2()); + ALIVE_onDead(ALdrive(), LED_off, l2()); + + BLINKER_setTimeOn(b1(), (KART_CST.DRIVE_STOP_TIME*9)/2); + BLINKER_setTimeOff(b1(), (KART_CST.DRIVE_STOP_TIME*9)/2); + BLINKER_onOn(b1(), foo, NULL); } //start all state machines void Factory_start() { CAN_startBehaviour(); - BLINKER_startBehaviour(b1()); - BLINKER_emitBlink(b1(), 0); ALIVE_startBehaviourSender(ALcontroller()); ALIVE_startBehaviourChecker(ALjoy()); ALIVE_emitBorn(ALjoy(), 100, 0); ALIVE_emitReady(ALjoy(), 200, 0); + ALIVE_startBehaviourChecker(ALdrive()); + ALIVE_emitBorn(ALdrive(), 100, 0); + ALIVE_emitReady(ALdrive(), 200, 0); + + BLINKER_startBehaviour(b1()); + BLINKER_emitBlink(b1(), 300); + } diff --git a/306-controller_interface.X/app/factory/factory.h b/306-controller_interface.X/app/factory/factory.h index 9835497..80a6acb 100644 --- a/306-controller_interface.X/app/factory/factory.h +++ b/306-controller_interface.X/app/factory/factory.h @@ -36,6 +36,7 @@ typedef struct { ALIVE ALcontroller_; ALIVE ALjoy_; + ALIVE ALdrive_; } Factory; @@ -58,6 +59,7 @@ BLINKER* b1(); ALIVE* ALcontroller(); ALIVE* ALjoy(); +ALIVE* ALdrive(); #endif \ No newline at end of file diff --git a/306-controller_interface.X/middleware/eeprom.c b/306-controller_interface.X/middleware/eeprom.c index 874f425..77708e7 100644 --- a/306-controller_interface.X/middleware/eeprom.c +++ b/306-controller_interface.X/middleware/eeprom.c @@ -35,11 +35,11 @@ void MEM_init(){ KART_CST.JOYSTICK_PARAM2 = 1; KART_CST.JOYSTICK_ALIVE_TIME = 25; - KART_CST.DISPLAY_ALIVE_TIME = 100; + KART_CST.DISPLAY_ALIVE_TIME = 100; - KART_CST.DRIVE_SPEED_TIME = 5; - KART_CST.DRIVE_STOP_TIME = 20; - KART_CST.DRIVE_ALIVE_TIME = 10; + KART_CST.DRIVE_SPEED_TIME = 20; + KART_CST.DRIVE_STOP_TIME = 10; + KART_CST.DRIVE_ALIVE_TIME = 25; KART_CST.STEERING_ALIVE_TIME = 100; From b95b6619e346c646265d1bd8795c32ae7b38bcad Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 31 Aug 2023 17:52:38 +0200 Subject: [PATCH 32/50] move eeprom to app --- 306-controller_interface.X/{middleware => app}/eeprom.c | 0 306-controller_interface.X/{middleware => app}/eeprom.h | 0 306-controller_interface.X/app/factory/factory.h | 2 +- 306-controller_interface.X/nbproject/configurations.xml | 4 ++-- 4 files changed, 3 insertions(+), 3 deletions(-) rename 306-controller_interface.X/{middleware => app}/eeprom.c (100%) rename 306-controller_interface.X/{middleware => app}/eeprom.h (100%) diff --git a/306-controller_interface.X/middleware/eeprom.c b/306-controller_interface.X/app/eeprom.c similarity index 100% rename from 306-controller_interface.X/middleware/eeprom.c rename to 306-controller_interface.X/app/eeprom.c diff --git a/306-controller_interface.X/middleware/eeprom.h b/306-controller_interface.X/app/eeprom.h similarity index 100% rename from 306-controller_interface.X/middleware/eeprom.h rename to 306-controller_interface.X/app/eeprom.h diff --git a/306-controller_interface.X/app/factory/factory.h b/306-controller_interface.X/app/factory/factory.h index 80a6acb..1b81d90 100644 --- a/306-controller_interface.X/app/factory/factory.h +++ b/306-controller_interface.X/app/factory/factory.h @@ -14,11 +14,11 @@ #include "../car.h" #include "../can_message.h" +#include "../eeprom.h" #include "../../board/led/led.h" #include "../../board/button/button.h" #include "../../middleware/alive.h" #include "../../middleware/can_interface.h" -#include "../../middleware/eeprom.h" #include "../../middleware/blinker.h" diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 70c7382..77dd0d1 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -8,8 +8,8 @@ app/factory/factory.h app/car.h app/can_message.h - middleware/eeprom.h app/kartculator.h + app/eeprom.h board/led/led.h @@ -46,8 +46,8 @@ app/factory/factory.c app/can_message.c - middleware/eeprom.c app/kartculator.c + app/eeprom.c board/led/led.c From 7aab0ef049d62d84f65a0b1b52ef17a37a29be20 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 31 Aug 2023 20:01:39 +0200 Subject: [PATCH 33/50] add resurrect for alive checker --- 306-controller_interface.X/middleware/alive.c | 8 ++++++-- 306-controller_interface.X/middleware/alive.h | 11 ++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/306-controller_interface.X/middleware/alive.c b/306-controller_interface.X/middleware/alive.c index 146e9f3..674e32e 100644 --- a/306-controller_interface.X/middleware/alive.c +++ b/306-controller_interface.X/middleware/alive.c @@ -80,8 +80,8 @@ bool ALIVE_processEvent(Event* ev) { break; case STAL_DEAD: - if (ev->id == evALborn) { - me->state = STAL_BORN; + if (ev->id == evALresurrect) { + me->state = STAL_SETUP; } break; @@ -238,6 +238,10 @@ void ALIVE_emitStart(ALIVE* me, uint16_t t, int64_t data) { POST(me, &ALIVE_processEvent, evALstart, t, data); } +void ALIVE_emitResurrect(ALIVE* me, uint16_t t, int64_t data) { + POST(me, &ALIVE_processEvent, evALresurrect, t, data); +} + /*********** * SETTERS * ***********/ diff --git a/306-controller_interface.X/middleware/alive.h b/306-controller_interface.X/middleware/alive.h index 749d9a9..580e735 100644 --- a/306-controller_interface.X/middleware/alive.h +++ b/306-controller_interface.X/middleware/alive.h @@ -25,7 +25,8 @@ typedef enum { evALborn, evALready, evALpoll, - evALstart + evALstart, + evALresurrect } ALIVE_EVENTS; typedef void (*ALIVE_CALLBACK_FUNCTION)(void*); @@ -162,6 +163,14 @@ void ALIVE_emitPoll(ALIVE* me, uint16_t t, int64_t data); */ void ALIVE_emitStart(ALIVE* me, uint16_t t, int64_t data); +/** + * Emit the resurrect event + * @param me the ALIVE itself + * @param t time to wait in ms before triggering event + * @param data data to put on the event for XF + */ +void ALIVE_emitResurrect(ALIVE* me, uint16_t t, int64_t data); + /*********** * SETTERS * From 2ece901b08ff654e725e8c3b170e2c1a6e825544 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 31 Aug 2023 20:02:25 +0200 Subject: [PATCH 34/50] add resurrect for alive checker --- UML/alive.uxf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/UML/alive.uxf b/UML/alive.uxf index f68ad3c..fe59b01 100644 --- a/UML/alive.uxf +++ b/UML/alive.uxf @@ -119,13 +119,13 @@ m1=evPoll\n[isAlive] Relation 224 - 392 - 336 - 560 + 252 + 378 + 700 lt=-> -m1=evBorn - 180.0;340.0;180.0;380.0;10.0;380.0;10.0;10.0;90.0;10.0 +m1=evResurrect + 180.0;440.0;180.0;480.0;10.0;480.0;10.0;10.0;90.0;10.0 Relation From a20667399bbb659305a3bc5ecf5f9bb217a3dccb Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 31 Aug 2023 20:02:41 +0200 Subject: [PATCH 35/50] add drive management --- 306-controller_interface.X/app/can_message.c | 15 +- 306-controller_interface.X/app/drive.c | 171 ++++++++++++++++++ 306-controller_interface.X/app/drive.h | 130 +++++++++++++ .../app/factory/factory.c | 39 +--- .../app/factory/factory.h | 5 +- .../nbproject/configurations.xml | 2 + UML/drive.pdf | Bin 0 -> 2392 bytes UML/drive.uxf | 137 ++++++++++++++ 8 files changed, 459 insertions(+), 40 deletions(-) create mode 100644 306-controller_interface.X/app/drive.c create mode 100644 306-controller_interface.X/app/drive.h create mode 100644 UML/drive.pdf create mode 100644 UML/drive.uxf diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 763192a..e32b8b2 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -171,8 +171,9 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ KART_CST.JOYSTICK_PARAM2 = MEM_read_1_byte(MEMADD_JOYSTICK_PARAM2); KART_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME); - ALIVE_emitBorn(ALjoy(), 0, 0); - ALIVE_emitReady(ALjoy(), 100, 0); + ALIVE_emitResurrect(ALjoy(), 0, 0); + ALIVE_emitBorn(ALjoy(), 100, 0); + ALIVE_emitReady(ALjoy(), 200, 0); } } break; @@ -204,18 +205,18 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ rpm.separate.byte2 = tmpData.separate.byte1; rpm.separate.byte3 = tmpData.separate.byte0; calcSpeed(rpm.full); + DRIVE_emitPollSpeed(drive()); } if(idMsg == 0xF) { // DRIVE_ALIVE // statusH statusL - - - ALIVE_ISALIVE(ALdrive()); - if(ALdrive()->state == STAL_DEAD){ + ALIVE_ISALIVE(&drive()->myChecker); + if(drive()->myChecker.state == STAL_DEAD){ KART_CST.DRIVE_SPEED_TIME = MEM_read_1_byte(MEMADD_DRIVE_SPEED_TIME); KART_CST.DRIVE_STOP_TIME = MEM_read_1_byte(MEMADD_DRIVE_STOP_TIME); KART_CST.DRIVE_ALIVE_TIME = MEM_read_1_byte(MEMADD_DRIVE_ALIVE_TIME); - ALIVE_setAliveTime(ALdrive(), KART_CST.DRIVE_ALIVE_TIME); - ALIVE_emitBorn(ALdrive(), 0, 0); - ALIVE_emitReady(ALdrive(), 100, 0); + ALIVE_emitResurrect(&drive()->myChecker, 0, 0); + ALIVE_emitBorn(&drive()->myChecker, 0, 0); } // TODO drive say ALIVE diff --git a/306-controller_interface.X/app/drive.c b/306-controller_interface.X/app/drive.c new file mode 100644 index 0000000..f926b1f --- /dev/null +++ b/306-controller_interface.X/app/drive.c @@ -0,0 +1,171 @@ +/** + * @author Rémi Heredero + * @version 1.0.0 + * @date August 2023 + * @file drive.c + */ + +#include "drive.h" +#include "car.h" +#include "can_message.h" + +void DRIVE_init(DRIVE* me){ + me->state = STDR_INIT; + ALIVE_init(&me->myChecker); + ALIVE_onSetup(&me->myChecker, CM_DRIVE_SETUP, NULL); + ALIVE_onWait(&me->myChecker, DRIVE_emitStart, me); + ALIVE_onDead(&me->myChecker, DRIVE_emitStop, me); + ALIVE_onBorn(&me->myChecker, DRIVE_emitResurrect, me); + me->wait.f = NULL; + me->run.f = NULL; + me->dead.f = NULL; +} + +void DRIVE_startBehaviour(DRIVE* me){ + POST(me, &DRIVE_processEvent, evDRinit, 0, 0); +} + +bool DRIVE_processEvent(Event* ev) { + bool processed = false; + DRIVE* me = (DRIVE*)Event_getTarget(ev); + DRIVE_STATES oldState = me->state; + evIDT evid = Event_getId(ev); + uint64_t data = Event_getData(ev); + + switch (me->state) { // onState + case STDR_INIT: + if (ev->id == evDRinit) { + me->state = STDR_WAIT; + ALIVE_startBehaviourChecker(&me->myChecker); // Start alive checker + } + break; + + case STDR_WAIT: + if (ev->id == evDRstart) { + me->state = STDR_RUN; + } + ALIVE_setAliveTime(&me->myChecker, KART_CST.DRIVE_ALIVE_TIME); + ALIVE_emitBorn(&me->myChecker, 100, 0); // Born after 100 ms + ALIVE_emitReady(&me->myChecker, 200, 0); // Ready after 200 ms + break; + + case STDR_RUN: + if (ev->id == evDRstop) { + me->state = STDR_DEAD; + } + + if (ev->id == evDRpollTorque) { + CM_DRIVE_POWER(&eKart.torque); + } + + if (ev->id == evDRpollSpeed) { + CM_DISPLAY_SPEED(&eKart.speed); + } + + DRIVE_emitPollTorque(me, KART_CST.DRIVE_STOP_TIME*9, 0); + break; + + case STDR_DEAD: + if (ev->id == evDRresurrect) { + me->state = STDR_WAIT; + } + break; + } + + if(oldState != me->state){ + switch (oldState) { // onExit + case STDR_INIT: + break; + + case STDR_WAIT: + break; + + case STDR_RUN: + break; + + case STDR_DEAD: + break; + } + + switch (me->state) { // onEntry + case STDR_INIT: + break; + + case STDR_WAIT: + if (me->wait.f != NULL) { + me->wait.f(me->wait.p); + } + break; + + case STDR_RUN: + if (me->run.f != NULL) { + me->run.f(me->run.p); + } + break; + + case STDR_DEAD: + if (me->dead.f != NULL) { + me->dead.f(me->dead.p); + } + break; + } + + processed = true; + } + return processed; +} + +/************* + * Callbacks * + *************/ + +void DRIVE_onWait(DRIVE* me, DRIVE_CALLBACK_FUNCTION f, void* p) { + me->wait.f = f; + me->wait.p = p; +} + +void DRIVE_onRun(DRIVE* me, DRIVE_CALLBACK_FUNCTION f, void* p) { + me->run.f = f; + me->run.p = p; +} + +void DRIVE_onDead(DRIVE* me, DRIVE_CALLBACK_FUNCTION f, void* p) { + me->dead.f = f; + me->dead.p = p; +} + +/************ + * EMITTERS * + ************/ + +void DRIVE_emitStart(void* p) { + DRIVE* me = (DRIVE*) p; + POST(me, &DRIVE_processEvent, evDRstart, 0, 0); +} + +void DRIVE_emitStop(void* p) { + DRIVE* me = (DRIVE*) p; + POST(me, &DRIVE_processEvent, evDRstop, 0, 0); +} + +void DRIVE_emitResurrect(void* p) { + DRIVE* me = (DRIVE*) p; + POST(me, &DRIVE_processEvent, evDRresurrect, 0, 0); +} + +void DRIVE_emitPollSpeed(void* p) { + DRIVE* me = (DRIVE*) p; + POST(me, &DRIVE_processEvent, evDRpollSpeed, 0, 0); +} + +void DRIVE_emitPollTorque(DRIVE* me, uint16_t t, int64_t data) { + POST(me, &DRIVE_processEvent, evDRpollTorque, t, data); +} + +/*********** + * SETTERS * + ***********/ + +void DRIVE_setMyChecker(DRIVE* me, ALIVE v) { + me->myChecker = v; +} diff --git a/306-controller_interface.X/app/drive.h b/306-controller_interface.X/app/drive.h new file mode 100644 index 0000000..647e66e --- /dev/null +++ b/306-controller_interface.X/app/drive.h @@ -0,0 +1,130 @@ +/** + * @author Rémi Heredero + * @version 1.0.0 + * @date August 2023 + * @file drive.h + */ +#ifndef DRIVE_H +#define DRIVE_H + +#include "../xf/xf.h" +#include "../middleware/alive.h" + +typedef enum { + STDR_INIT, + STDR_WAIT, + STDR_RUN, + STDR_DEAD +} DRIVE_STATES; + +typedef enum { + evDRinit = 100, + evDRstart, + evDRstop, + evDRresurrect, + evDRpollSpeed, + evDRpollTorque +} DRIVE_EVENTS; + +typedef void (*DRIVE_CALLBACK_FUNCTION)(void*); +typedef struct { + DRIVE_CALLBACK_FUNCTION f; // function + void* p; // param(s) +} DRIVE_CALLBACK; + +typedef struct { + DRIVE_STATES state; + ALIVE myChecker; + DRIVE_CALLBACK wait; + DRIVE_CALLBACK run; + DRIVE_CALLBACK dead; +} DRIVE; + +/** + * Initialize the DRIVE + * @param me the DRIVE itself + */ +void DRIVE_init(DRIVE* me); + +/** + * Start the DRIVE state machine + * @param me the DRIVE itself + */ +void DRIVE_startBehaviour(DRIVE* me); + +/** + * Process the event + * @param ev the event to process + * @return true if the event is processed + */ +bool DRIVE_processEvent(Event* ev); + +/************* + * Callbacks * + *************/ + +/** + * Set the callback function to call when the DRIVE is entering state wait + * @param me the DRIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void DRIVE_onWait(DRIVE* me, DRIVE_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the DRIVE is entering state run + * @param me the DRIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void DRIVE_onRun(DRIVE* me, DRIVE_CALLBACK_FUNCTION f, void* p); + +/** + * Set the callback function to call when the DRIVE is entering state dead + * @param me the DRIVE itself + * @param f the function to call + * @param p the param(s) to pass to the function + */ +void DRIVE_onDead(DRIVE* me, DRIVE_CALLBACK_FUNCTION f, void* p); + +/************ + * EMITTERS * + ************/ + +/** + * Emit the start event + * @param p the DRIVE itself + */ +void DRIVE_emitStart(void* p); + +/** + * Emit the stop event + * @param p the DRIVE itself + */ +void DRIVE_emitStop(void* p); + +/** + * Emit the resurrect event + * @param p the DRIVE itself + */ +void DRIVE_emitResurrect(void* p); + +/** + * Emit the pollSpeed event + * @param p the DRIVE itself + */ +void DRIVE_emitPollSpeed(void* p); + +/** + * Emit the pollTorque event + * @param p the DRIVE itself + */ +void DRIVE_emitPollTorque(DRIVE* me, uint16_t t, int64_t data); + +/*********** + * SETTERS * + ***********/ + + + +#endif diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index a2905fa..12121f8 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -42,8 +42,8 @@ ALIVE* ALjoy(){ return &theFactory.ALjoy_; } -ALIVE* ALdrive(){ - return &theFactory.ALdrive_; +DRIVE* drive(){ + return &theFactory.drive_; } @@ -79,20 +79,7 @@ void Factory_init() { ALIVE_setAliveTime(ALcontroller(), KART_CST.CONTROL_ALIVE_TIME); ALIVE_init(ALjoy()); - ALIVE_init(ALdrive()); -} - -void foo(void* p){ - static int16_t speed = 0; - static bool up = true; - if(up) { - speed += 3; - if(speed >100) up = false; - } else { - speed -= 3; - if(speed < -100) up = true; - } - CM_DRIVE_POWER(&speed); + DRIVE_init(drive()); } //connect objects if required @@ -110,31 +97,21 @@ void Factory_build() { ALIVE_onBorn(ALjoy(), LED_on, l1()); ALIVE_onDead(ALjoy(), LED_off, l1()); - ALIVE_onSetup(ALdrive(), CM_DRIVE_SETUP, NULL); - ALIVE_setAliveTime(ALdrive(), KART_CST.DRIVE_ALIVE_TIME); - ALIVE_onBorn(ALdrive(), LED_on, l2()); - ALIVE_onDead(ALdrive(), LED_off, l2()); + DRIVE_onRun(drive(), LED_on, l2()); + DRIVE_onDead(drive(), LED_off, l2()); - BLINKER_setTimeOn(b1(), (KART_CST.DRIVE_STOP_TIME*9)/2); - BLINKER_setTimeOff(b1(), (KART_CST.DRIVE_STOP_TIME*9)/2); - BLINKER_onOn(b1(), foo, NULL); } //start all state machines void Factory_start() { CAN_startBehaviour(); - - ALIVE_startBehaviourSender(ALcontroller()); - ALIVE_startBehaviourChecker(ALjoy()); + //ALIVE_startBehaviourSender(ALcontroller()); + //ALIVE_startBehaviourChecker(ALjoy()); ALIVE_emitBorn(ALjoy(), 100, 0); ALIVE_emitReady(ALjoy(), 200, 0); - ALIVE_startBehaviourChecker(ALdrive()); - ALIVE_emitBorn(ALdrive(), 100, 0); - ALIVE_emitReady(ALdrive(), 200, 0); - BLINKER_startBehaviour(b1()); - BLINKER_emitBlink(b1(), 300); + DRIVE_startBehaviour(drive()); } diff --git a/306-controller_interface.X/app/factory/factory.h b/306-controller_interface.X/app/factory/factory.h index 1b81d90..1a35e49 100644 --- a/306-controller_interface.X/app/factory/factory.h +++ b/306-controller_interface.X/app/factory/factory.h @@ -15,6 +15,7 @@ #include "../car.h" #include "../can_message.h" #include "../eeprom.h" +#include "../drive.h" #include "../../board/led/led.h" #include "../../board/button/button.h" #include "../../middleware/alive.h" @@ -36,7 +37,7 @@ typedef struct { ALIVE ALcontroller_; ALIVE ALjoy_; - ALIVE ALdrive_; + DRIVE drive_; } Factory; @@ -59,7 +60,7 @@ BLINKER* b1(); ALIVE* ALcontroller(); ALIVE* ALjoy(); -ALIVE* ALdrive(); +DRIVE* drive(); #endif \ No newline at end of file diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index 77dd0d1..cf78aa9 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -10,6 +10,7 @@ app/can_message.h app/kartculator.h app/eeprom.h + app/drive.h board/led/led.h @@ -48,6 +49,7 @@ app/can_message.c app/kartculator.c app/eeprom.c + app/drive.c board/led/led.c diff --git a/UML/drive.pdf b/UML/drive.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5935edf4a27a1a7ea9aa25b683ee6bcadde9a440 GIT binary patch literal 2392 zcmai0Yg7~076!Q@Mz0SPDIz*3ph(F)@?aE*H%$OhLU@QE??8qagbXGj1fx}0h*+@} zZ!K3)%1bX60fT@jZ!6S-8Z4rsMa5u2p%kUy1BK2|T3pJy_xzcC_P1xBZ}0D{J!9#? zb+(16bc*F;t)`7)2S5NG7D;h%0NpT&NWL9_5hesWi=*V26m*Uf$T2P!jtemsOD30M zf@q5JM5kXgf0^BavD&)JE7+07s<)+zHwO(;3VzD(D(>QxeAlXW&2BMUHp^(dcBr&u z*4IV;>_ujmR83kFmE({y;$m|!pJw{?A$K1C{5$c8c~x`Si|qE9W05|Xdt4no7z-)Y zMx~hyi}atloQTabDf+zm^LM;LZ~FM1c}>SRv>|L8t#~QQHp=4y^19rG|2}EAD32AQ zZT@}Rp3}P73E8reRNKMP+$Ck0D#^OL!lR)_?eSy5jP2J7;`QtGDvQhG&m}dS-o-MP zCbk)d)}+9ntoC;c;|M=pNsG&gy`UP4mZYFOPP( zVCLWPbEDM}TUdYSRd0ISyK2Them5mUX>M=a0JLmgl!; zYGr1g2)BKiCIN^@YuaHXTn0uwyiqc9gxlulrkvy4emDQB*ye#>{lVe&<Mh*gDq3_4PvZUK z4MJ7tl+WMZFt5BdxpQv0e##e*64wOyji^Bz=lY|)gVu=X!6-(F>nfR|gi}hDtlGqx z4B);M2wcN<@o=+MU{aYFmjqf{gB;?+DJN_$A@>^YdIUmf5K4n#6r#~-HW0EJf>v9D zJY4uc1Ez{mO0ftEM0}|!1c%85Fc}OQ1Bd`7eXt!w+zWC6lD~aS8X?bzzG>nZFwwsc z;~3NALqEy~K`^282k+WVb1qT($8qS#J`{P6i(D!YM`2R(cg0)03nN+pdf_;sIw`Lg z=qic8feG;ln+pUuU`zx!NMwtq@b Wk;w&8`Gf}WIuxZ?S~~HaDSrTd$f(Q! literal 0 HcmV?d00001 diff --git a/UML/drive.uxf b/UML/drive.uxf new file mode 100644 index 0000000..0f5e6c9 --- /dev/null +++ b/UML/drive.uxf @@ -0,0 +1,137 @@ + + + 15 + + Relation + + 660 + 90 + 210 + 120 + + lt=-> +evInit +/startAliveChecker + + 10.0;10.0;10.0;60.0 + + + UMLSpecialState + + 660 + 75 + 30 + 30 + + type=initial + + + + UMLState + + 540 + 405 + 270 + 105 + + RUN +-- +/entry: LED ON +-- +emitPollTorqueEv + + + + Relation + + 735 + 450 + 195 + 270 + + lt=-> +m1= evPollTorque\n/sendTorque + + 10.0;100.0;10.0;160.0;110.0;160.0;110.0;10.0;50.0;10.0 + + + UMLState + + 495 + 180 + 360 + 135 + + WAIT +-- +ALIVE_emitBorn(ALjoy(), 0, 0); +ALIVE_emitReady(ALjoy(), 100, 0); +setAliveTime + + + + Relation + + 660 + 300 + 120 + 135 + + lt=-> +m1=evStart\n(onWait) + + 10.0;10.0;10.0;70.0 + + + Relation + + 735 + 450 + 195 + 180 + + lt=-> +m1= evPollSpeed\n/sendSpeed + + 10.0;40.0;10.0;100.0;110.0;100.0;110.0;10.0;50.0;10.0 + + + Relation + + 390 + 240 + 345 + 555 + + lt=-> +m1= evResurrect\n(onBorn) + + 130.0;300.0;130.0;350.0;10.0;350.0;10.0;10.0;70.0;10.0 + + + UMLState + + 450 + 600 + 270 + 90 + + DEAD +-- +/entry: LED OFF + + + + Relation + + 570 + 495 + 135 + 135 + + lt=-> +m1=evStop\n(onDead) + + 10.0;10.0;10.0;70.0 + + From b52b7736331bbdaccface9784ba8097e7fca537e Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 31 Aug 2023 20:03:01 +0200 Subject: [PATCH 36/50] add CAN_MESSAGE --- UML/class.uxf | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/UML/class.uxf b/UML/class.uxf index 4e335b5..550ed7d 100644 --- a/UML/class.uxf +++ b/UML/class.uxf @@ -1,13 +1,13 @@ - 7 + 10 UMLClass - 105 - 77 - 301 - 126 + 80 + 100 + 430 + 180 CAN_INTERFACE -- @@ -28,10 +28,10 @@ CAN_setSender(idSender: uint8_t): void UMLClass - 315 - 350 - 301 - 126 + 0 + 390 + 430 + 180 JOYSTICK -- @@ -51,10 +51,33 @@ CAN_setSender(idSender: uint8_t): void UMLClass - 812 - 154 - 322 - 504 + 580 + 370 + 490 + 210 + + MEMORY_CST +-- ++CM_processIncome(idSender: uint8_t, idMsg: uint8_t, data: uint32_t): void ++CM_CONTROLLER_ALIVE(p: void*): void ++CM_JOY_SETUP(p: void*): void ++CM_DISPLAY_SETUP(p: void*): void ++CM_DISPLAY_SPEED(p: void*): void ++CM_DISPLAY_DIRECTION(p: void*): void ++CM_DRIVE_SETUP(p: void*): void ++CM_DRIVE_POWER(p: void*): void ++CM_STEERING_SETUP(p: void*): void ++CM_STEERING_SET(p: void*): void ++CM_SUPPLY_SETUP(p: void*): void + + + + UMLClass + + 1140 + 40 + 460 + 720 MEMORY_CST -- From 296575a4b936eef232217946a138856e803df980 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Thu, 31 Aug 2023 20:03:24 +0200 Subject: [PATCH 37/50] add filter --- busmaster_config.cfx | 302 +++++++++++++++++++++++-------------------- 1 file changed, 161 insertions(+), 141 deletions(-) diff --git a/busmaster_config.cfx b/busmaster_config.cfx index 67531f2..2e79b88 100644 --- a/busmaster_config.cfx +++ b/busmaster_config.cfx @@ -2,7 +2,7 @@ 3.2.2 - TRUE + FALSE FALSE FALSE FALSE @@ -124,130 +124,6 @@ - - noAlive - STOP - - 271 - 271 - ALL - ALL - ALL - 0 - - - 543 - 543 - ALL - ALL - ALL - 0 - - - 799 - 799 - ALL - ALL - ALL - 0 - - - 1055 - 1055 - ALL - ALL - ALL - 0 - - - 1311 - 1311 - ALL - ALL - ALL - 0 - - - - drive - PASS - - 320 - 320 - ALL - ALL - ALL - 0 - - - 321 - 321 - ALL - ALL - ALL - 0 - - - 1040 - 1040 - ALL - ALL - ALL - 0 - - - 1055 - 1055 - ALL - ALL - ALL - 0 - - - - steering - PASS - - 336 - 336 - ALL - ALL - ALL - 0 - - - 337 - 337 - ALL - ALL - ALL - 0 - - - 1298 - 1298 - ALL - ALL - ALL - 0 - - - 1311 - 1311 - ALL - ALL - ALL - 0 - - - 82 - 82 - ALL - ALL - ALL - 0 - - display PASS @@ -308,6 +184,42 @@ 0 + + drive + PASS + + 320 + 320 + ALL + ALL + ALL + 0 + + + 321 + 321 + ALL + ALL + ALL + 0 + + + 1040 + 1040 + ALL + ALL + ALL + 0 + + + 1055 + 1055 + ALL + ALL + ALL + 0 + + joy PASS @@ -336,8 +248,102 @@ 0 + + noAlive + STOP + + 271 + 271 + ALL + ALL + ALL + 0 + + + 543 + 543 + ALL + ALL + ALL + 0 + + + 799 + 799 + ALL + ALL + ALL + 0 + + + 1055 + 1055 + ALL + ALL + ALL + 0 + + + 1311 + 1311 + ALL + ALL + ALL + 0 + + + + steering + PASS + + 336 + 336 + ALL + ALL + ALL + 0 + + + 337 + 337 + ALL + ALL + ALL + 0 + + + 1298 + 1298 + ALL + ALL + ALL + 0 + + + 1311 + 1311 + ALL + ALL + ALL + 0 + + + 82 + 82 + ALL + ALL + ALL + 0 + + + + 529 + posY + posX + button + 1040 Speed @@ -348,17 +354,17 @@ 320 + aliveTime resetInit speedTime stopTime - aliveTime 336 - RESET ALIVE_TIME - SET_CENTER HOMING + RESET + SET_CENTER 82 @@ -431,24 +437,38 @@ TRUE NORMAL + + 321 + DRIVE_POWER + + Power + Physical + SOLID + 16711680 + 1 + 8388736 + TRUE + TRUE + NORMAL + - HIDE - HIDE - -1 - 0 - 0 - 0 + SHOWNORMAL + SHOWNORMAL + 292 + 109 + 829 + 1419 - -1 + 479 0 - 0 + 804 0 - 0 + 489 0 @@ -760,9 +780,9 @@ SHOWNORMAL SETMINPOSITION 3 - 1055 + 1052 658 - 1915 + 1912 @@ -795,7 +815,7 @@ FALSE FALSE 2 - 0,100 + 255,255 10 FALSE a @@ -843,7 +863,7 @@ FALSE FALSE 2 - 0,0 + 0,50 10 FALSE a From 26ea7d0870b6c255a50f00c31f538fc0a909c5ab Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 10:40:11 +0200 Subject: [PATCH 38/50] fix compiler --- 306-controller_interface.X/app/can_message.c | 84 ++++++++------------ 306-controller_interface.X/app/kartculator.c | 4 +- 2 files changed, 35 insertions(+), 53 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index e32b8b2..c348e70 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -21,6 +21,8 @@ typedef union { uint32_t full; } BYTES_4; +//BYTES_4 foobar; + typedef union { struct { uint8_t byte0; @@ -30,7 +32,16 @@ typedef union { } BYTES_2; void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ + BYTES_4 incomeData; + incomeData.full = data; + BYTES_4 revertData; + revertData.separate.byte0 = incomeData.separate.byte3; + revertData.separate.byte1 = incomeData.separate.byte2; + revertData.separate.byte2 = incomeData.separate.byte1; + revertData.separate.byte3 = incomeData.separate.byte0; + switch(idSender){ + //foobar.full = data; /********************* * BROADCAST / DEBUG * @@ -38,13 +49,11 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 0: if(idMsg == 0x0) { // CONTROL_SETUP // steeringMode eraseMemory - controlAliveTime - BYTES_4 tmpData; - tmpData.full = data; - if (tmpData.separate.byte1) { + if (incomeData.separate.byte1) { MEM_reset(); } - KART_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0; - KART_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3; + KART_CST.CONTROL_STEERING_MODE = incomeData.separate.byte0; + KART_CST.CONTROL_ALIVE_TIME = incomeData.separate.byte3; MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, KART_CST.CONTROL_STEERING_MODE); MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, KART_CST.CONTROL_ALIVE_TIME); ALIVE_setAliveTime(ALcontroller(), KART_CST.CONTROL_ALIVE_TIME); @@ -73,10 +82,8 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0x4) { // CONTROL_SECURITY_PARAM // maxSpeedFw maxSpeedBw - - - BYTES_4 tmpData; - tmpData.full = data; - KART_CST.CONTROL_MAX_SPEED_FW = tmpData.separate.byte0; - KART_CST.CONTROL_MAX_SPEED_BW = tmpData.separate.byte1; + KART_CST.CONTROL_MAX_SPEED_FW = incomeData.separate.byte0; + KART_CST.CONTROL_MAX_SPEED_BW = incomeData.separate.byte1; MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_FW, KART_CST.CONTROL_MAX_SPEED_FW); MEM_write_1_byte(MEMADD_CONTROL_MAX_SPEED_BW, KART_CST.CONTROL_MAX_SPEED_BW); @@ -84,10 +91,8 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0x5) { // CONTROL_SETUP_PARAM // displayAliveTime steeringAliveTime - - - BYTES_4 tmpData; - tmpData.full = data; - KART_CST.DISPLAY_ALIVE_TIME = tmpData.separate.byte0; - KART_CST.STEERING_ALIVE_TIME = tmpData.separate.byte1; + KART_CST.DISPLAY_ALIVE_TIME = incomeData.separate.byte0; + KART_CST.STEERING_ALIVE_TIME = incomeData.separate.byte1; MEM_write_1_byte(MEMADD_DISPLAY_ALIVE_TIME, KART_CST.DISPLAY_ALIVE_TIME); MEM_write_1_byte(MEMADD_STEERING_ALIVE_TIME, KART_CST.STEERING_ALIVE_TIME); // TODO set alive times @@ -97,12 +102,10 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0x6) { // CONTROL_SETUP_PARAM_JOY // joystickMode joystickParam1 joystickParam2 joystickAliveTime - BYTES_4 tmpData; - tmpData.full = data; - KART_CST.JOYSTICK_MODE = tmpData.separate.byte0; - KART_CST.JOYSTICK_PARAM1 = tmpData.separate.byte1; - KART_CST.JOYSTICK_PARAM2 = tmpData.separate.byte2; - KART_CST.JOYSTICK_ALIVE_TIME = tmpData.separate.byte3; + KART_CST.JOYSTICK_MODE = incomeData.separate.byte0; + KART_CST.JOYSTICK_PARAM1 = incomeData.separate.byte1; + KART_CST.JOYSTICK_PARAM2 = incomeData.separate.byte2; + KART_CST.JOYSTICK_ALIVE_TIME = incomeData.separate.byte3; MEM_write_1_byte(MEMADD_JOYSTICK_MODE, KART_CST.JOYSTICK_MODE); MEM_write_1_byte(MEMADD_JOYSTICK_PARAM1, KART_CST.JOYSTICK_PARAM1); MEM_write_1_byte(MEMADD_JOYSTICK_PARAM2, KART_CST.JOYSTICK_PARAM2); @@ -115,11 +118,9 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0x7) { // CONTROL_SETUP_PARAM_DRIVE // driveAliveTime driveSpeedTime driveStopTime - - BYTES_4 tmpData; - tmpData.full = data; - KART_CST.DRIVE_ALIVE_TIME = tmpData.separate.byte0; - KART_CST.DRIVE_SPEED_TIME = tmpData.separate.byte1; - KART_CST.DRIVE_STOP_TIME = tmpData.separate.byte2; + KART_CST.DRIVE_ALIVE_TIME = incomeData.separate.byte0; + KART_CST.DRIVE_SPEED_TIME = incomeData.separate.byte1; + KART_CST.DRIVE_STOP_TIME = incomeData.separate.byte2; MEM_write_1_byte(MEMADD_DRIVE_ALIVE_TIME, KART_CST.DRIVE_ALIVE_TIME); MEM_write_1_byte(MEMADD_DRIVE_SPEED_TIME, KART_CST.DRIVE_SPEED_TIME); MEM_write_1_byte(MEMADD_DRIVE_STOP_TIME, KART_CST.DRIVE_STOP_TIME); @@ -130,12 +131,10 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ if(idMsg == 0x8) { // CONTROL_SETUP_PARAM_BATTERY // batteryVoltTime batteryCurrentTime batteryEnergyTime batteryAliveTime - BYTES_4 tmpData; - tmpData.full = data; - KART_CST.BATTERY_VOLT_TIME = tmpData.separate.byte0; - KART_CST.BATTERY_CURRENT_TIME = tmpData.separate.byte1; - KART_CST.BATTERY_ENERGY_TIME = tmpData.separate.byte2; - KART_CST.BATTERY_ALIVE_TIME = tmpData.separate.byte3; + KART_CST.BATTERY_VOLT_TIME = incomeData.separate.byte0; + KART_CST.BATTERY_CURRENT_TIME = incomeData.separate.byte1; + KART_CST.BATTERY_ENERGY_TIME = incomeData.separate.byte2; + KART_CST.BATTERY_ALIVE_TIME = incomeData.separate.byte3; MEM_write_1_byte(MEMADD_BATTERY_VOLT_TIME, KART_CST.BATTERY_VOLT_TIME); MEM_write_1_byte(MEMADD_BATTERY_CURRENT_TIME, KART_CST.BATTERY_CURRENT_TIME); MEM_write_1_byte(MEMADD_BATTERY_ENERGY_TIME, KART_CST.BATTERY_ENERGY_TIME); @@ -154,11 +153,8 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 2: if(idMsg == 0x1) { // JOY_MESURE // posX posY button - - BYTES_4 tmpData; - tmpData.full = data; - - calcTorque(tmpData.separate.byte1); - calcPosition(tmpData.separate.byte0); + calcTorque(incomeData.separate.byte1); + calcPosition(incomeData.separate.byte0); } @@ -197,14 +193,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 4: if(idMsg == 0x0) { // DRIVE_SPEED // speedHH speedH speedL speedLL - BYTES_4 tmpData; - tmpData.full = data; - BYTES_4 rpm; - rpm.separate.byte0 = tmpData.separate.byte3; - rpm.separate.byte1 = tmpData.separate.byte2; - rpm.separate.byte2 = tmpData.separate.byte1; - rpm.separate.byte3 = tmpData.separate.byte0; - calcSpeed(rpm.full); + calcSpeed(revertData.full); DRIVE_emitPollSpeed(drive()); } @@ -230,14 +219,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ case 5: if(idMsg == 0x1) { // STEERING_GET_CENTER // valHH valH valL valLL - BYTES_4 tmpData; - tmpData.full = data; - BYTES_4 center; - center.separate.byte0 = tmpData.separate.byte3; - center.separate.byte1 = tmpData.separate.byte2; - center.separate.byte2 = tmpData.separate.byte1; - center.separate.byte3 = tmpData.separate.byte0; - eKart.center = center.full; + eKart.center = revertData.full; } if(idMsg == 0x2) { // STEERING_GET_POSITION diff --git a/306-controller_interface.X/app/kartculator.c b/306-controller_interface.X/app/kartculator.c index deeecae..3b271b5 100644 --- a/306-controller_interface.X/app/kartculator.c +++ b/306-controller_interface.X/app/kartculator.c @@ -9,7 +9,7 @@ void calcTorque(uint8_t joy_pos) { int32_t calcTorque; - calcTorque = joy_pos; // joystick position + calcTorque = (int8_t) joy_pos; // joystick position calcTorque *= KART_CST.CONTROL_POWER_FACTOR; // convert by power factor calcTorque /= 1000; // torque define by joystick eKart.torque = (int16_t) calcTorque; @@ -17,7 +17,7 @@ void calcTorque(uint8_t joy_pos) { void calcPosition(uint8_t joy_pos){ int32_t calcPosition; - calcPosition = joy_pos; + calcPosition = (int8_t) joy_pos; } void calcSpeed(int32_t rpm) { From d94fcb927d5304ddc706c36cf3349cbcf01d06ae Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 10:40:20 +0200 Subject: [PATCH 39/50] add makefiles --- 306-controller_interface.X/.gitignore | 1 - .../nbproject/Makefile-default.mk | 450 ++++++++++++++++++ .../nbproject/Makefile-impl.mk | 69 +++ .../nbproject/Makefile-local-default.mk | 38 ++ .../nbproject/Makefile-variables.mk | 10 + 5 files changed, 567 insertions(+), 1 deletion(-) create mode 100644 306-controller_interface.X/nbproject/Makefile-default.mk create mode 100644 306-controller_interface.X/nbproject/Makefile-impl.mk create mode 100644 306-controller_interface.X/nbproject/Makefile-local-default.mk create mode 100644 306-controller_interface.X/nbproject/Makefile-variables.mk diff --git a/306-controller_interface.X/.gitignore b/306-controller_interface.X/.gitignore index f24b170..11426d8 100644 --- a/306-controller_interface.X/.gitignore +++ b/306-controller_interface.X/.gitignore @@ -7,7 +7,6 @@ debug/ dist/ disassembly/ nbproject/private/ -nbproject/*.mk nbproject/*.bash nbproject/Makefile-genesis.properties diff --git a/306-controller_interface.X/nbproject/Makefile-default.mk b/306-controller_interface.X/nbproject/Makefile-default.mk new file mode 100644 index 0000000..59030e4 --- /dev/null +++ b/306-controller_interface.X/nbproject/Makefile-default.mk @@ -0,0 +1,450 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Include project Makefile +ifeq "${IGNORE_LOCAL}" "TRUE" +# do not include local makefile. User is passing all local related variables already +else +include Makefile +# Include makefile containing local settings +ifeq "$(wildcard nbproject/Makefile-local-default.mk)" "nbproject/Makefile-local-default.mk" +include nbproject/Makefile-local-default.mk +endif +endif + +# Environment +MKDIR=gnumkdir -p +RM=rm -f +MV=mv +CP=cp + +# Macros +CND_CONF=default +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +IMAGE_TYPE=debug +OUTPUT_SUFFIX=elf +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +else +IMAGE_TYPE=production +OUTPUT_SUFFIX=hex +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +endif + +ifeq ($(COMPARE_BUILD), true) +COMPARISON_BUILD=-mafrlcsj +else +COMPARISON_BUILD= +endif + +ifdef SUB_IMAGE_ADDRESS + +else +SUB_IMAGE_ADDRESS_COMMAND= +endif + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} + +# Distribution Directory +DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} + +# Source Files Quoted if spaced +SOURCEFILES_QUOTED_IF_SPACED=app/factory/factory.c app/can_message.c app/kartculator.c app/eeprom.c app/drive.c board/led/led.c mcc_generated_files/interrupt_manager.c mcc_generated_files/tmr0.c mcc_generated_files/pin_manager.c mcc_generated_files/device_config.c mcc_generated_files/mcc.c mcc_generated_files/ecan.c mcc_generated_files/memory.c middleware/can_interface.c middleware/alive.c middleware/blinker.c xf/event.c xf/xf.c main.c + +# Object Files Quoted if spaced +OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/app/factory/factory.p1 ${OBJECTDIR}/app/can_message.p1 ${OBJECTDIR}/app/kartculator.p1 ${OBJECTDIR}/app/eeprom.p1 ${OBJECTDIR}/app/drive.p1 ${OBJECTDIR}/board/led/led.p1 ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1 ${OBJECTDIR}/mcc_generated_files/tmr0.p1 ${OBJECTDIR}/mcc_generated_files/pin_manager.p1 ${OBJECTDIR}/mcc_generated_files/device_config.p1 ${OBJECTDIR}/mcc_generated_files/mcc.p1 ${OBJECTDIR}/mcc_generated_files/ecan.p1 ${OBJECTDIR}/mcc_generated_files/memory.p1 ${OBJECTDIR}/middleware/can_interface.p1 ${OBJECTDIR}/middleware/alive.p1 ${OBJECTDIR}/middleware/blinker.p1 ${OBJECTDIR}/xf/event.p1 ${OBJECTDIR}/xf/xf.p1 ${OBJECTDIR}/main.p1 +POSSIBLE_DEPFILES=${OBJECTDIR}/app/factory/factory.p1.d ${OBJECTDIR}/app/can_message.p1.d ${OBJECTDIR}/app/kartculator.p1.d ${OBJECTDIR}/app/eeprom.p1.d ${OBJECTDIR}/app/drive.p1.d ${OBJECTDIR}/board/led/led.p1.d ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1.d ${OBJECTDIR}/mcc_generated_files/tmr0.p1.d ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d ${OBJECTDIR}/mcc_generated_files/device_config.p1.d ${OBJECTDIR}/mcc_generated_files/mcc.p1.d ${OBJECTDIR}/mcc_generated_files/ecan.p1.d ${OBJECTDIR}/mcc_generated_files/memory.p1.d ${OBJECTDIR}/middleware/can_interface.p1.d ${OBJECTDIR}/middleware/alive.p1.d ${OBJECTDIR}/middleware/blinker.p1.d ${OBJECTDIR}/xf/event.p1.d ${OBJECTDIR}/xf/xf.p1.d ${OBJECTDIR}/main.p1.d + +# Object Files +OBJECTFILES=${OBJECTDIR}/app/factory/factory.p1 ${OBJECTDIR}/app/can_message.p1 ${OBJECTDIR}/app/kartculator.p1 ${OBJECTDIR}/app/eeprom.p1 ${OBJECTDIR}/app/drive.p1 ${OBJECTDIR}/board/led/led.p1 ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1 ${OBJECTDIR}/mcc_generated_files/tmr0.p1 ${OBJECTDIR}/mcc_generated_files/pin_manager.p1 ${OBJECTDIR}/mcc_generated_files/device_config.p1 ${OBJECTDIR}/mcc_generated_files/mcc.p1 ${OBJECTDIR}/mcc_generated_files/ecan.p1 ${OBJECTDIR}/mcc_generated_files/memory.p1 ${OBJECTDIR}/middleware/can_interface.p1 ${OBJECTDIR}/middleware/alive.p1 ${OBJECTDIR}/middleware/blinker.p1 ${OBJECTDIR}/xf/event.p1 ${OBJECTDIR}/xf/xf.p1 ${OBJECTDIR}/main.p1 + +# Source Files +SOURCEFILES=app/factory/factory.c app/can_message.c app/kartculator.c app/eeprom.c app/drive.c board/led/led.c mcc_generated_files/interrupt_manager.c mcc_generated_files/tmr0.c mcc_generated_files/pin_manager.c mcc_generated_files/device_config.c mcc_generated_files/mcc.c mcc_generated_files/ecan.c mcc_generated_files/memory.c middleware/can_interface.c middleware/alive.c middleware/blinker.c xf/event.c xf/xf.c main.c + + + +CFLAGS= +ASFLAGS= +LDLIBSOPTIONS= + +############# Tool locations ########################################## +# If you copy a project from one host to another, the path where the # +# compiler is installed may be different. # +# If you open this project with MPLAB X in the new host, this # +# makefile will be regenerated and the paths will be corrected. # +####################################################################### +# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build +FIXDEPS=fixDeps + +.build-conf: ${BUILD_SUBPROJECTS} +ifneq ($(INFORMATION_MESSAGE), ) + @echo $(INFORMATION_MESSAGE) +endif + ${MAKE} -f nbproject/Makefile-default.mk ${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} + +MP_PROCESSOR_OPTION=18F26K83 +# ------------------------------------------------------------------------------------ +# Rules for buildStep: compile +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${OBJECTDIR}/app/factory/factory.p1: app/factory/factory.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app/factory" + @${RM} ${OBJECTDIR}/app/factory/factory.p1.d + @${RM} ${OBJECTDIR}/app/factory/factory.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/factory/factory.p1 app/factory/factory.c + @-${MV} ${OBJECTDIR}/app/factory/factory.d ${OBJECTDIR}/app/factory/factory.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/factory/factory.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/app/can_message.p1: app/can_message.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app" + @${RM} ${OBJECTDIR}/app/can_message.p1.d + @${RM} ${OBJECTDIR}/app/can_message.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/can_message.p1 app/can_message.c + @-${MV} ${OBJECTDIR}/app/can_message.d ${OBJECTDIR}/app/can_message.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/can_message.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/app/kartculator.p1: app/kartculator.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app" + @${RM} ${OBJECTDIR}/app/kartculator.p1.d + @${RM} ${OBJECTDIR}/app/kartculator.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/kartculator.p1 app/kartculator.c + @-${MV} ${OBJECTDIR}/app/kartculator.d ${OBJECTDIR}/app/kartculator.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/kartculator.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/app/eeprom.p1: app/eeprom.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app" + @${RM} ${OBJECTDIR}/app/eeprom.p1.d + @${RM} ${OBJECTDIR}/app/eeprom.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/eeprom.p1 app/eeprom.c + @-${MV} ${OBJECTDIR}/app/eeprom.d ${OBJECTDIR}/app/eeprom.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/eeprom.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/app/drive.p1: app/drive.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app" + @${RM} ${OBJECTDIR}/app/drive.p1.d + @${RM} ${OBJECTDIR}/app/drive.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/drive.p1 app/drive.c + @-${MV} ${OBJECTDIR}/app/drive.d ${OBJECTDIR}/app/drive.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/drive.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/board/led/led.p1: board/led/led.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/board/led" + @${RM} ${OBJECTDIR}/board/led/led.p1.d + @${RM} ${OBJECTDIR}/board/led/led.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/board/led/led.p1 board/led/led.c + @-${MV} ${OBJECTDIR}/board/led/led.d ${OBJECTDIR}/board/led/led.p1.d + @${FIXDEPS} ${OBJECTDIR}/board/led/led.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1: mcc_generated_files/interrupt_manager.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1 mcc_generated_files/interrupt_manager.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/interrupt_manager.d ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/tmr0.p1: mcc_generated_files/tmr0.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/tmr0.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/tmr0.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/tmr0.p1 mcc_generated_files/tmr0.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/tmr0.d ${OBJECTDIR}/mcc_generated_files/tmr0.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/tmr0.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/pin_manager.p1: mcc_generated_files/pin_manager.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/pin_manager.p1 mcc_generated_files/pin_manager.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/pin_manager.d ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/device_config.p1: mcc_generated_files/device_config.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/device_config.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/device_config.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/device_config.p1 mcc_generated_files/device_config.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/device_config.d ${OBJECTDIR}/mcc_generated_files/device_config.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/device_config.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/mcc.p1: mcc_generated_files/mcc.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/mcc.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/mcc.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/mcc.p1 mcc_generated_files/mcc.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/mcc.d ${OBJECTDIR}/mcc_generated_files/mcc.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/mcc.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/ecan.p1: mcc_generated_files/ecan.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/ecan.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/ecan.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/ecan.p1 mcc_generated_files/ecan.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/ecan.d ${OBJECTDIR}/mcc_generated_files/ecan.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/ecan.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/memory.p1: mcc_generated_files/memory.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/memory.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/memory.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/memory.p1 mcc_generated_files/memory.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/memory.d ${OBJECTDIR}/mcc_generated_files/memory.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/memory.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/middleware/can_interface.p1: middleware/can_interface.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/middleware" + @${RM} ${OBJECTDIR}/middleware/can_interface.p1.d + @${RM} ${OBJECTDIR}/middleware/can_interface.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/middleware/can_interface.p1 middleware/can_interface.c + @-${MV} ${OBJECTDIR}/middleware/can_interface.d ${OBJECTDIR}/middleware/can_interface.p1.d + @${FIXDEPS} ${OBJECTDIR}/middleware/can_interface.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/middleware/alive.p1: middleware/alive.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/middleware" + @${RM} ${OBJECTDIR}/middleware/alive.p1.d + @${RM} ${OBJECTDIR}/middleware/alive.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/middleware/alive.p1 middleware/alive.c + @-${MV} ${OBJECTDIR}/middleware/alive.d ${OBJECTDIR}/middleware/alive.p1.d + @${FIXDEPS} ${OBJECTDIR}/middleware/alive.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/middleware/blinker.p1: middleware/blinker.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/middleware" + @${RM} ${OBJECTDIR}/middleware/blinker.p1.d + @${RM} ${OBJECTDIR}/middleware/blinker.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/middleware/blinker.p1 middleware/blinker.c + @-${MV} ${OBJECTDIR}/middleware/blinker.d ${OBJECTDIR}/middleware/blinker.p1.d + @${FIXDEPS} ${OBJECTDIR}/middleware/blinker.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/xf/event.p1: xf/event.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/xf" + @${RM} ${OBJECTDIR}/xf/event.p1.d + @${RM} ${OBJECTDIR}/xf/event.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/xf/event.p1 xf/event.c + @-${MV} ${OBJECTDIR}/xf/event.d ${OBJECTDIR}/xf/event.p1.d + @${FIXDEPS} ${OBJECTDIR}/xf/event.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/xf/xf.p1: xf/xf.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/xf" + @${RM} ${OBJECTDIR}/xf/xf.p1.d + @${RM} ${OBJECTDIR}/xf/xf.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/xf/xf.p1 xf/xf.c + @-${MV} ${OBJECTDIR}/xf/xf.d ${OBJECTDIR}/xf/xf.p1.d + @${FIXDEPS} ${OBJECTDIR}/xf/xf.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/main.p1: main.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/main.p1.d + @${RM} ${OBJECTDIR}/main.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -mdebugger=pickit3 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/main.p1 main.c + @-${MV} ${OBJECTDIR}/main.d ${OBJECTDIR}/main.p1.d + @${FIXDEPS} ${OBJECTDIR}/main.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +else +${OBJECTDIR}/app/factory/factory.p1: app/factory/factory.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app/factory" + @${RM} ${OBJECTDIR}/app/factory/factory.p1.d + @${RM} ${OBJECTDIR}/app/factory/factory.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/factory/factory.p1 app/factory/factory.c + @-${MV} ${OBJECTDIR}/app/factory/factory.d ${OBJECTDIR}/app/factory/factory.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/factory/factory.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/app/can_message.p1: app/can_message.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app" + @${RM} ${OBJECTDIR}/app/can_message.p1.d + @${RM} ${OBJECTDIR}/app/can_message.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/can_message.p1 app/can_message.c + @-${MV} ${OBJECTDIR}/app/can_message.d ${OBJECTDIR}/app/can_message.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/can_message.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/app/kartculator.p1: app/kartculator.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app" + @${RM} ${OBJECTDIR}/app/kartculator.p1.d + @${RM} ${OBJECTDIR}/app/kartculator.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/kartculator.p1 app/kartculator.c + @-${MV} ${OBJECTDIR}/app/kartculator.d ${OBJECTDIR}/app/kartculator.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/kartculator.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/app/eeprom.p1: app/eeprom.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app" + @${RM} ${OBJECTDIR}/app/eeprom.p1.d + @${RM} ${OBJECTDIR}/app/eeprom.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/eeprom.p1 app/eeprom.c + @-${MV} ${OBJECTDIR}/app/eeprom.d ${OBJECTDIR}/app/eeprom.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/eeprom.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/app/drive.p1: app/drive.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/app" + @${RM} ${OBJECTDIR}/app/drive.p1.d + @${RM} ${OBJECTDIR}/app/drive.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/app/drive.p1 app/drive.c + @-${MV} ${OBJECTDIR}/app/drive.d ${OBJECTDIR}/app/drive.p1.d + @${FIXDEPS} ${OBJECTDIR}/app/drive.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/board/led/led.p1: board/led/led.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/board/led" + @${RM} ${OBJECTDIR}/board/led/led.p1.d + @${RM} ${OBJECTDIR}/board/led/led.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/board/led/led.p1 board/led/led.c + @-${MV} ${OBJECTDIR}/board/led/led.d ${OBJECTDIR}/board/led/led.p1.d + @${FIXDEPS} ${OBJECTDIR}/board/led/led.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1: mcc_generated_files/interrupt_manager.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1 mcc_generated_files/interrupt_manager.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/interrupt_manager.d ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/interrupt_manager.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/tmr0.p1: mcc_generated_files/tmr0.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/tmr0.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/tmr0.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/tmr0.p1 mcc_generated_files/tmr0.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/tmr0.d ${OBJECTDIR}/mcc_generated_files/tmr0.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/tmr0.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/pin_manager.p1: mcc_generated_files/pin_manager.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/pin_manager.p1 mcc_generated_files/pin_manager.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/pin_manager.d ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/device_config.p1: mcc_generated_files/device_config.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/device_config.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/device_config.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/device_config.p1 mcc_generated_files/device_config.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/device_config.d ${OBJECTDIR}/mcc_generated_files/device_config.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/device_config.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/mcc.p1: mcc_generated_files/mcc.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/mcc.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/mcc.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/mcc.p1 mcc_generated_files/mcc.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/mcc.d ${OBJECTDIR}/mcc_generated_files/mcc.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/mcc.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/ecan.p1: mcc_generated_files/ecan.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/ecan.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/ecan.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/ecan.p1 mcc_generated_files/ecan.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/ecan.d ${OBJECTDIR}/mcc_generated_files/ecan.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/ecan.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/mcc_generated_files/memory.p1: mcc_generated_files/memory.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/mcc_generated_files" + @${RM} ${OBJECTDIR}/mcc_generated_files/memory.p1.d + @${RM} ${OBJECTDIR}/mcc_generated_files/memory.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/mcc_generated_files/memory.p1 mcc_generated_files/memory.c + @-${MV} ${OBJECTDIR}/mcc_generated_files/memory.d ${OBJECTDIR}/mcc_generated_files/memory.p1.d + @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/memory.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/middleware/can_interface.p1: middleware/can_interface.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/middleware" + @${RM} ${OBJECTDIR}/middleware/can_interface.p1.d + @${RM} ${OBJECTDIR}/middleware/can_interface.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/middleware/can_interface.p1 middleware/can_interface.c + @-${MV} ${OBJECTDIR}/middleware/can_interface.d ${OBJECTDIR}/middleware/can_interface.p1.d + @${FIXDEPS} ${OBJECTDIR}/middleware/can_interface.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/middleware/alive.p1: middleware/alive.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/middleware" + @${RM} ${OBJECTDIR}/middleware/alive.p1.d + @${RM} ${OBJECTDIR}/middleware/alive.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/middleware/alive.p1 middleware/alive.c + @-${MV} ${OBJECTDIR}/middleware/alive.d ${OBJECTDIR}/middleware/alive.p1.d + @${FIXDEPS} ${OBJECTDIR}/middleware/alive.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/middleware/blinker.p1: middleware/blinker.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/middleware" + @${RM} ${OBJECTDIR}/middleware/blinker.p1.d + @${RM} ${OBJECTDIR}/middleware/blinker.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/middleware/blinker.p1 middleware/blinker.c + @-${MV} ${OBJECTDIR}/middleware/blinker.d ${OBJECTDIR}/middleware/blinker.p1.d + @${FIXDEPS} ${OBJECTDIR}/middleware/blinker.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/xf/event.p1: xf/event.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/xf" + @${RM} ${OBJECTDIR}/xf/event.p1.d + @${RM} ${OBJECTDIR}/xf/event.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/xf/event.p1 xf/event.c + @-${MV} ${OBJECTDIR}/xf/event.d ${OBJECTDIR}/xf/event.p1.d + @${FIXDEPS} ${OBJECTDIR}/xf/event.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/xf/xf.p1: xf/xf.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}/xf" + @${RM} ${OBJECTDIR}/xf/xf.p1.d + @${RM} ${OBJECTDIR}/xf/xf.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/xf/xf.p1 xf/xf.c + @-${MV} ${OBJECTDIR}/xf/xf.d ${OBJECTDIR}/xf/xf.p1.d + @${FIXDEPS} ${OBJECTDIR}/xf/xf.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/main.p1: main.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/main.p1.d + @${RM} ${OBJECTDIR}/main.p1 + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -DXPRJ_default=$(CND_CONF) -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits $(COMPARISON_BUILD) -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o ${OBJECTDIR}/main.p1 main.c + @-${MV} ${OBJECTDIR}/main.d ${OBJECTDIR}/main.p1.d + @${FIXDEPS} ${OBJECTDIR}/main.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ + +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assemble +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +else +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assembleWithPreprocess +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +else +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: link +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} ${DISTDIR} + ${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.map -D__DEBUG=1 -mdebugger=pickit3 -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} + @${RM} ${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.hex + +else +${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} ${DISTDIR} + ${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.map -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -fno-short-double -fno-short-float -memi=wordwrite -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/306-controller_interface.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} + +endif + + +# Subprojects +.build-subprojects: + + +# Subprojects +.clean-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${OBJECTDIR} + ${RM} -r ${DISTDIR} + +# Enable dependency checking +.dep.inc: .depcheck-impl + +DEPFILES=$(shell mplabwildcard ${POSSIBLE_DEPFILES}) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/306-controller_interface.X/nbproject/Makefile-impl.mk b/306-controller_interface.X/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..d489d6a --- /dev/null +++ b/306-controller_interface.X/nbproject/Makefile-impl.mk @@ -0,0 +1,69 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=306-controller_interface.X + +# Active Configuration +DEFAULTCONF=default +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=default + + +# build +.build-impl: .build-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default clean + + + +# all +.all-impl: .all-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default build + + + +# dependency checking support +.depcheck-impl: +# @echo "# This code depends on make tool being used" >.dep.inc +# @if [ -n "${MAKE_VERSION}" ]; then \ +# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ +# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ +# echo "include \$${DEPFILES}" >>.dep.inc; \ +# echo "endif" >>.dep.inc; \ +# else \ +# echo ".KEEP_STATE:" >>.dep.inc; \ +# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ +# fi diff --git a/306-controller_interface.X/nbproject/Makefile-local-default.mk b/306-controller_interface.X/nbproject/Makefile-local-default.mk new file mode 100644 index 0000000..c86914d --- /dev/null +++ b/306-controller_interface.X/nbproject/Makefile-local-default.mk @@ -0,0 +1,38 @@ +# +# Generated Makefile - do not edit! +# +# +# This file contains information about the location of compilers and other tools. +# If you commmit this file into your revision control server, you will be able to +# to checkout the project and build it from the command line with make. However, +# if more than one person works on the same project, then this file might show +# conflicts since different users are bound to have compilers in different places. +# In that case you might choose to not commit this file and let MPLAB X recreate this file +# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at +# least once so the file gets created and the project can be built. Finally, you can also +# avoid using this file at all if you are only building from the command line with make. +# You can invoke make with the values of the macros: +# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ... +# +SHELL=cmd.exe +PATH_TO_IDE_BIN=C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/ +# Adding MPLAB X bin directory to path. +PATH:=C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH) +# Path to java used to run MPLAB X when this makefile was created +MP_JAVA_PATH="C:\Program Files\Microchip\MPLABX\v6.00\sys\java\zulu8.54.0.21-ca-fx-jre8.0.292-win_x64/bin/" +OS_CURRENT="$(shell uname -s)" +MP_CC="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-cc.exe" +# MP_CPPC is not defined +# MP_BC is not defined +MP_AS="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-cc.exe" +MP_LD="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-cc.exe" +MP_AR="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-ar.exe" +DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" +MP_CC_DIR="C:\Program Files\Microchip\xc8\v2.41\bin" +# MP_CPPC_DIR is not defined +# MP_BC_DIR is not defined +MP_AS_DIR="C:\Program Files\Microchip\xc8\v2.41\bin" +MP_LD_DIR="C:\Program Files\Microchip\xc8\v2.41\bin" +MP_AR_DIR="C:\Program Files\Microchip\xc8\v2.41\bin" +# MP_BC_DIR is not defined +DFP_DIR=C:/Users/remi.heredero/.mchp_packs/Microchip/PIC18F-K_DFP/1.7.134 diff --git a/306-controller_interface.X/nbproject/Makefile-variables.mk b/306-controller_interface.X/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..de1b034 --- /dev/null +++ b/306-controller_interface.X/nbproject/Makefile-variables.mk @@ -0,0 +1,10 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +# default configuration +CND_ARTIFACT_DIR_default=dist/default/production +CND_ARTIFACT_NAME_default=306-controller_interface.X.production.hex +CND_ARTIFACT_PATH_default=dist/default/production/306-controller_interface.X.production.hex From ae9252cccb66aea0f067dc0fcc80fe5b4938eb4b Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 13:22:35 +0200 Subject: [PATCH 40/50] clean --- 306-controller_interface.X/app/can_message.c | 7 ++----- 306-controller_interface.X/app/factory/factory.c | 7 ++++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index c348e70..f815446 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -21,8 +21,6 @@ typedef union { uint32_t full; } BYTES_4; -//BYTES_4 foobar; - typedef union { struct { uint8_t byte0; @@ -41,7 +39,6 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ revertData.separate.byte3 = incomeData.separate.byte0; switch(idSender){ - //foobar.full = data; /********************* * BROADCAST / DEBUG * @@ -168,8 +165,8 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ KART_CST.JOYSTICK_ALIVE_TIME = MEM_read_1_byte(MEMADD_JOYSTICK_ALIVE_TIME); ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME); ALIVE_emitResurrect(ALjoy(), 0, 0); - ALIVE_emitBorn(ALjoy(), 100, 0); - ALIVE_emitReady(ALjoy(), 200, 0); + ALIVE_emitBorn(ALjoy(), 0, 0); + ALIVE_emitReady(ALjoy(), 0, 0); } } break; diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index 12121f8..41b271d 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -106,12 +106,13 @@ void Factory_build() { void Factory_start() { CAN_startBehaviour(); - //ALIVE_startBehaviourSender(ALcontroller()); - //ALIVE_startBehaviourChecker(ALjoy()); + DRIVE_startBehaviour(drive()); + + ALIVE_startBehaviourSender(ALcontroller()); + ALIVE_startBehaviourChecker(ALjoy()); ALIVE_emitBorn(ALjoy(), 100, 0); ALIVE_emitReady(ALjoy(), 200, 0); - DRIVE_startBehaviour(drive()); } From 1ea26b2a6cc5b10e25afb1dd9a0db9c0c9c15b7a Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 13:22:45 +0200 Subject: [PATCH 41/50] fix alive --- UML/alive.pdf | Bin 3736 -> 3743 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/UML/alive.pdf b/UML/alive.pdf index 47870de23692ec49421a6752b17b97330e54098a..cd22870e25766201a097a1c4c139f281f06e4321 100644 GIT binary patch delta 2570 zcmah~c{CJi8^4T{iCfCpDu!%hoqeI~p^%a^L>M7!3qvy3T-kTiFohON#%@dzp|UiT z2}P1EpOMB864}jM_xt|&zT=+rz32Iz_kDincb@0>ob#OX-aGQ>NQR0q97$2blKm|0 zb9WE!;~oS-^6k1tow7+AgfOA~c|`qNRTKWG97^c(X5rWTWyO-QvOYFY{sYp&<_Zy<0QhTV&TL*~^gc^m^vgY6 z(ylrL`Se|JfB41G)vic4Cz6ux~?>^natvb}!wZxCOtp5KgMeo2}nsD4=?bJl~N-ZWZr zbK`Te)|C_z8;Ln|nr$yno42_Y6rqLQT4p52^QC^h+M4!;1+3S(^_(lSsWcp%nvT?x zZUfWm!rFc{xCOqhyr3t2`-?k`Q&kBHT(*0RUktiBH$aG3X(=B9X3wlGyc&;Mq)6Jc3kZ=zA0_rj z*YE91SQ?^xNtR;xq2zli(La&Z@@F zMq2AhzGA(_Tpx8ZJ3qjg?B|-Gwrc1q!|9L_eIBU%hC;~5MVpc%9^)GheGL_Pj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ua#I-VkLUkH5LgHT>l@y?pHB(SghkKaoV}{ZL>xSoJRx@mJGkd5AnJyQ= zgG*YD?jaOlJgpu+a}+PDYJdt3UhIMCTF5?ma*;~e>0apGz!xoH=N`CL0~w&3ewf=~ zm)ou2EduwgB}<>}4;{J_b7Z(e%k92@iqkkrN+X)O6ms_Yu~S*-msO`s7hI=nmNcW( z(b+i92I>h6;uFy&4%`nsc(dT{xZ!qiq&U?tqZATl;}SO{>n=6GYbTuJ1v9&6%nFIl zGG4B?tgW)0+QbIIH!dc3!{?^+LL=v~qJvvpWx>0GV?gMd@61tk986uIGVZdhQM*$< z+j?@Ab=NQNh%n2jE&G+*SZg(@&UyaWV`{Eq%obO>E&BFGy_=vj9}Oo2p>=@(+I^5L z&1hGr2+7ip?w0Uwv3FVUE~^mg)kFbk9bKK>dkhAs!C-0{+V(--7M`Ibbqjp}2Ebwe zG0?JvkrXrlhr<3o&_F2Y9{~f9y2zgy`e&vG|3wxF{FFr@fA*n(e|&cTH5jdn`ZUSy&>}>k2LRB~qm~XB(7yq Date: Fri, 1 Sep 2023 13:23:09 +0200 Subject: [PATCH 42/50] up queue for XF timer --- 306-controller_interface.X/xf/xf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/306-controller_interface.X/xf/xf.h b/306-controller_interface.X/xf/xf.h index b74e185..1d280d8 100644 --- a/306-controller_interface.X/xf/xf.h +++ b/306-controller_interface.X/xf/xf.h @@ -27,7 +27,7 @@ typedef struct Timer_ // timer structure /*----------------------------------------------------------------------------*/ /* depending on usage, change MAXTIMER and MAXEVENT */ /*----------------------------------------------------------------------------*/ -#define MAXTIMER 8 // number of timers in our system +#define MAXTIMER 15 // number of timers in our system #define MAXEVENT 20 // number of events in our system #define NULLTIMER 0 // no value for time From 397b77ab5a1d398fa385d83a6c04cafad1407c05 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 13:23:26 +0200 Subject: [PATCH 43/50] fix alive break --- 306-controller_interface.X/middleware/alive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/306-controller_interface.X/middleware/alive.c b/306-controller_interface.X/middleware/alive.c index 674e32e..e661ded 100644 --- a/306-controller_interface.X/middleware/alive.c +++ b/306-controller_interface.X/middleware/alive.c @@ -92,7 +92,7 @@ bool ALIVE_processEvent(Event* ev) { } if (me->aliveTime == 0) { if (me->haveBreak){ - me->state == STAL_BREAK; + me->state = STAL_BREAK; } } else { ALIVE_emitPoll(me, me->aliveTime*10, 0); From 4750463f7bd6596187363cb6fa48f91af91f964b Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 16:32:37 +0200 Subject: [PATCH 44/50] fix break --- 306-controller_interface.X/middleware/alive.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/306-controller_interface.X/middleware/alive.c b/306-controller_interface.X/middleware/alive.c index e661ded..1565dd3 100644 --- a/306-controller_interface.X/middleware/alive.c +++ b/306-controller_interface.X/middleware/alive.c @@ -142,6 +142,7 @@ bool ALIVE_processEvent(Event* ev) { break; case STAL_SETUP: + me->checker = true; if (me->setup.f != NULL) { me->setup.f(me->setup.p); } @@ -166,6 +167,7 @@ bool ALIVE_processEvent(Event* ev) { break; case STAL_ALIVE: + me->sender = true; break; case STAL_BREAK: From 863977e20ff24925df604308f959451e5f2aabb0 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 16:32:51 +0200 Subject: [PATCH 45/50] define default settings --- 306-controller_interface.X/app/eeprom.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/306-controller_interface.X/app/eeprom.c b/306-controller_interface.X/app/eeprom.c index 77708e7..2e1ba5d 100644 --- a/306-controller_interface.X/app/eeprom.c +++ b/306-controller_interface.X/app/eeprom.c @@ -21,14 +21,14 @@ typedef union { void MEM_init(){ uint8_t check = MEM_read_1_byte(0x0); - if(check != 0x42){ + if(check != 0x2A){ KART_CST.CONTROL_STEERING_MODE = 0; KART_CST.CONTROL_ALIVE_TIME = 50; - KART_CST.CONTROL_SPEED_FACTOR = 0; + KART_CST.CONTROL_SPEED_FACTOR = 111111; KART_CST.CONTROL_POWER_FACTOR = 10000; KART_CST.CONTROL_STEERING_FACTOR = 400000000; - KART_CST.CONTROL_MAX_SPEED_FW = 500; - KART_CST.CONTROL_MAX_SPEED_BW = 250; + KART_CST.CONTROL_MAX_SPEED_FW = 50; + KART_CST.CONTROL_MAX_SPEED_BW = 25; KART_CST.JOYSTICK_MODE = 0; KART_CST.JOYSTICK_PARAM1 = 5; @@ -39,7 +39,7 @@ void MEM_init(){ KART_CST.DRIVE_SPEED_TIME = 20; KART_CST.DRIVE_STOP_TIME = 10; - KART_CST.DRIVE_ALIVE_TIME = 25; + KART_CST.DRIVE_ALIVE_TIME = 250; KART_CST.STEERING_ALIVE_TIME = 100; @@ -74,7 +74,7 @@ void MEM_init(){ MEM_write_1_byte(MEMADD_BATTERY_ENERGY_TIME, KART_CST.BATTERY_ENERGY_TIME); MEM_write_1_byte(MEMADD_BATTERY_ALIVE_TIME, KART_CST.BATTERY_ALIVE_TIME); - MEM_write_1_byte(0x0, 0x42); + MEM_write_1_byte(0x0, 0x2A); } else { KART_CST.CONTROL_STEERING_MODE = MEM_read_1_byte(MEMADD_CONTROL_STEERING_MODE); KART_CST.CONTROL_ALIVE_TIME = MEM_read_1_byte(MEMADD_CONTROL_ALIVE_TIME); From 9b304aec93df91363150c6851586a45a35174f5c Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 16:37:46 +0200 Subject: [PATCH 46/50] speed kartculator --- 306-controller_interface.X/app/kartculator.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/306-controller_interface.X/app/kartculator.c b/306-controller_interface.X/app/kartculator.c index 3b271b5..88a490b 100644 --- a/306-controller_interface.X/app/kartculator.c +++ b/306-controller_interface.X/app/kartculator.c @@ -21,7 +21,15 @@ void calcPosition(uint8_t joy_pos){ } void calcSpeed(int32_t rpm) { - + int32_t calcSpeed; + if(rpm>=0){ + calcSpeed = rpm; + } else { + calcSpeed = -rpm; + } + calcSpeed *= 1000; + calcSpeed /= KART_CST.CONTROL_SPEED_FACTOR; + eKart.speed = (uint8_t) calcSpeed; } int16_t getTorque() { From 33dc145a80c32b6a9135ac957d8c7f0df0766de5 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 16:37:58 +0200 Subject: [PATCH 47/50] add setup param messages --- threewheeler.DBF | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/threewheeler.DBF b/threewheeler.DBF index b2261ba..2cc5931 100644 --- a/threewheeler.DBF +++ b/threewheeler.DBF @@ -6,7 +6,7 @@ [BUSMASTER_VERSION] [3.2.2] -[NUMBER_OF_MESSAGES] 26 +[NUMBER_OF_MESSAGES] 29 [START_MSG] JOY_MEASURE,529,3,3,1,S [START_SIGNALS] posX,8,1,0,I,127,-128,1,0.000000,1.000000,%, @@ -72,7 +72,7 @@ [VALUE_DESCRIPTION] No alive message,0 [END_MSG] -[START_MSG] DISPLAY_SETUP,48,4,1,1,S +[START_MSG] DISPLAY_SETUP,304,4,1,1,S [START_SIGNALS] AliveTime,8,4,0,U,255,0,1,0.000000,10.000000,ms, [END_MSG] @@ -158,4 +158,22 @@ [START_SIGNALS] timeMeasureOrDeltaX,8,2,0,U,255,0,1,0.000000,10.000000,msOrVal, [START_SIGNALS] DeltaY,8,3,0,U,255,0,1,0.000000,1.000000,val, [START_SIGNALS] aliveTime,8,4,0,U,255,0,1,0.000000,10.000000,ms, +[END_MSG] + +[START_MSG] CONTROL_SETUP_DRIVE,23,4,3,1,S +[START_SIGNALS] driveAliveTime,8,1,0,U,255,0,1,0.000000,10.000000,ms, +[START_SIGNALS] driveSpeedTime,8,2,0,U,255,0,1,0.000000,10.000000,ms, +[START_SIGNALS] driveStopTime,8,3,0,U,255,0,1,0.000000,10.000000,ms, +[END_MSG] + +[START_MSG] CONTROL_SETUP_PARAM_BATTERY,24,4,4,1,S +[START_SIGNALS] batteryVoltTime,8,1,0,U,255,0,1,0.000000,10.000000,ms, +[START_SIGNALS] batteryCurentTime,8,2,0,U,255,0,1,0.000000,10.000000,ms, +[START_SIGNALS] batteryEnergyTime,8,3,0,U,255,0,1,0.000000,10.000000,ms, +[START_SIGNALS] batteryAliveTime,8,4,0,U,255,0,1,0.000000,10.000000,ms, +[END_MSG] + +[START_MSG] CONTROL_SETUP_PARAM,21,4,2,1,S +[START_SIGNALS] displayAliveTime,8,1,0,U,255,0,1,0.000000,10.000000,ms, +[START_SIGNALS] steeringAliveTime,8,2,0,U,255,0,1,0.000000,10.000000,ms, [END_MSG] \ No newline at end of file From 59dcf4e47c04d3077906bc7a90eb31def52a86d3 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 16:38:10 +0200 Subject: [PATCH 48/50] update can messages --- 306-controller_interface.X/app/can_message.c | 6 +- 306-controller_interface.X/defmplabxtrace.log | 0 .../defmplabxtrace.log.inx | Bin 0 -> 25 bytes .../nbproject/Makefile-default.mk | 8 +- .../nbproject/Makefile-local-default.mk | 9 +- .../nbproject/configurations.xml | 1030 ----------------- 6 files changed, 9 insertions(+), 1044 deletions(-) create mode 100644 306-controller_interface.X/defmplabxtrace.log create mode 100644 306-controller_interface.X/defmplabxtrace.log.inx diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index f815446..2e53ae4 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -54,6 +54,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, KART_CST.CONTROL_STEERING_MODE); MEM_write_1_byte(MEMADD_CONTROL_ALIVE_TIME, KART_CST.CONTROL_ALIVE_TIME); ALIVE_setAliveTime(ALcontroller(), KART_CST.CONTROL_ALIVE_TIME); + ALIVE_emitStart(ALcontroller(), 0, 0); } if(idMsg == 0x1) { // CONTROL_SPEED_FACTOR @@ -109,6 +110,7 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ MEM_write_1_byte(MEMADD_JOYSTICK_ALIVE_TIME, KART_CST.JOYSTICK_ALIVE_TIME); ALIVE_setAliveTime(ALjoy(), KART_CST.JOYSTICK_ALIVE_TIME); + ALIVE_emitStart(ALjoy(), 0, 0); CM_JOY_SETUP(NULL); } @@ -121,7 +123,8 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ MEM_write_1_byte(MEMADD_DRIVE_ALIVE_TIME, KART_CST.DRIVE_ALIVE_TIME); MEM_write_1_byte(MEMADD_DRIVE_SPEED_TIME, KART_CST.DRIVE_SPEED_TIME); MEM_write_1_byte(MEMADD_DRIVE_STOP_TIME, KART_CST.DRIVE_STOP_TIME); - // TODO set alive time + ALIVE_setAliveTime(drive()->myChecker, KART_CST.DRIVE_ALIVE_TIME); + CM_DRIVE_SETUP(NULL); // TODO send params } @@ -204,7 +207,6 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ ALIVE_emitResurrect(&drive()->myChecker, 0, 0); ALIVE_emitBorn(&drive()->myChecker, 0, 0); } - // TODO drive say ALIVE } break; diff --git a/306-controller_interface.X/defmplabxtrace.log b/306-controller_interface.X/defmplabxtrace.log new file mode 100644 index 0000000..e69de29 diff --git a/306-controller_interface.X/defmplabxtrace.log.inx b/306-controller_interface.X/defmplabxtrace.log.inx new file mode 100644 index 0000000000000000000000000000000000000000..29197e3a865f7122649ec45edb31854093b4a422 GIT binary patch literal 25 NcmZQzKn1)oE&u?I01f~E literal 0 HcmV?d00001 diff --git a/306-controller_interface.X/nbproject/Makefile-default.mk b/306-controller_interface.X/nbproject/Makefile-default.mk index 59030e4..17547ef 100644 --- a/306-controller_interface.X/nbproject/Makefile-default.mk +++ b/306-controller_interface.X/nbproject/Makefile-default.mk @@ -44,12 +44,6 @@ else COMPARISON_BUILD= endif -ifdef SUB_IMAGE_ADDRESS - -else -SUB_IMAGE_ADDRESS_COMMAND= -endif - # Object Directory OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} @@ -444,7 +438,7 @@ endif # Enable dependency checking .dep.inc: .depcheck-impl -DEPFILES=$(shell mplabwildcard ${POSSIBLE_DEPFILES}) +DEPFILES=$(wildcard ${POSSIBLE_DEPFILES}) ifneq (${DEPFILES},) include ${DEPFILES} endif diff --git a/306-controller_interface.X/nbproject/Makefile-local-default.mk b/306-controller_interface.X/nbproject/Makefile-local-default.mk index c86914d..14e862a 100644 --- a/306-controller_interface.X/nbproject/Makefile-local-default.mk +++ b/306-controller_interface.X/nbproject/Makefile-local-default.mk @@ -15,11 +15,11 @@ # $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ... # SHELL=cmd.exe -PATH_TO_IDE_BIN=C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/ +PATH_TO_IDE_BIN=C:/Program Files/Microchip/MPLABX/v6.15/mplab_platform/platform/../mplab_ide/modules/../../bin/ # Adding MPLAB X bin directory to path. -PATH:=C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH) +PATH:=C:/Program Files/Microchip/MPLABX/v6.15/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH) # Path to java used to run MPLAB X when this makefile was created -MP_JAVA_PATH="C:\Program Files\Microchip\MPLABX\v6.00\sys\java\zulu8.54.0.21-ca-fx-jre8.0.292-win_x64/bin/" +MP_JAVA_PATH="C:\Program Files\Microchip\MPLABX\v6.15\sys\java\zulu8.64.0.19-ca-fx-jre8.0.345-win_x64/bin/" OS_CURRENT="$(shell uname -s)" MP_CC="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-cc.exe" # MP_CPPC is not defined @@ -27,12 +27,11 @@ MP_CC="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-cc.exe" MP_AS="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-cc.exe" MP_LD="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-cc.exe" MP_AR="C:\Program Files\Microchip\xc8\v2.41\bin\xc8-ar.exe" -DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" +DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files/Microchip/MPLABX/v6.15/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" MP_CC_DIR="C:\Program Files\Microchip\xc8\v2.41\bin" # MP_CPPC_DIR is not defined # MP_BC_DIR is not defined MP_AS_DIR="C:\Program Files\Microchip\xc8\v2.41\bin" MP_LD_DIR="C:\Program Files\Microchip\xc8\v2.41\bin" MP_AR_DIR="C:\Program Files\Microchip\xc8\v2.41\bin" -# MP_BC_DIR is not defined DFP_DIR=C:/Users/remi.heredero/.mchp_packs/Microchip/PIC18F-K_DFP/1.7.134 diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index cf78aa9..ac746da 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -210,1036 +210,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 1ad382063cf43af56edc1a8358bbc561efccd70d Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 17:24:17 +0200 Subject: [PATCH 49/50] add setup msg --- busmaster_config.cfx | 237 +++++++++++++++++++------------------------ 1 file changed, 104 insertions(+), 133 deletions(-) diff --git a/busmaster_config.cfx b/busmaster_config.cfx index 2e79b88..f5a4e23 100644 --- a/busmaster_config.cfx +++ b/busmaster_config.cfx @@ -9,7 +9,7 @@ FALSE FALSE TRUE - FALSE + TRUE SYSTEM FALSE FALSE @@ -42,28 +42,14 @@ 90 1 - - - Parameter - 1 - 200 - 1 - - - Channel 1 - 2 - 90 - 1 - - SHOWNORMAL RESTORETOMAXIMIZED - 388 - 612 - 1002 - 1034 + 517 + 489 + 1014 + 911 @@ -341,8 +327,8 @@ 529 posY - posX button + posX 1040 @@ -353,18 +339,15 @@ Power - 320 - aliveTime - resetInit - speedTime - stopTime + 306 + Vehiclespeed 336 - ALIVE_TIME HOMING RESET SET_CENTER + ALIVE_TIME 82 @@ -377,15 +360,15 @@ SHOWNORMAL HIDE - 150 - 608 - 1098 - 437 + 165 + 599 + 1089 + 452 - 94 + 147 94 - 189 + 139 94 @@ -454,25 +437,25 @@ SHOWNORMAL SHOWNORMAL - 292 - 109 - 829 - 1419 + 291 + 205 + 957 + 1530 479 0 - 804 + 819 0 - 489 + 308 0 - 0 + 308 0 @@ -508,28 +491,28 @@ 1489464112 - 23901712 + 26186104 1489464084 display drive - joy + joy noAlive steering - 1 - 0 - 0 + 5 + 1 + 19 Time - 5 + 4 1 129 Tx/Rx - 4 + 1 1 53 @@ -567,11 +550,11 @@ Data Byte(s) 9 1 - 158 + 139 1 - 1 - 0 + 0 + 1 SYSTEM SHOWNORMAL @@ -785,6 +768,78 @@ 1912 + + 1 + 16 + FALSE + FALSE + 4 + 0,0,0,10 + 10 + FALSE + a + FALSE + + + 1 + 17 + FALSE + FALSE + 4 + 0,0,0,0 + 10 + FALSE + a + FALSE + + + 1 + 18 + FALSE + FALSE + 4 + 0,0,0,0 + 10 + FALSE + a + FALSE + + + 1 + 19 + FALSE + FALSE + 4 + 0,0,0,0 + 10 + FALSE + a + FALSE + + + 1 + 20 + FALSE + FALSE + 2 + 0,0 + 10 + FALSE + a + FALSE + + + 1 + 21 + FALSE + FALSE + 4 + 0,0,0,0 + 10 + FALSE + a + FALSE + 1 22 @@ -797,90 +852,6 @@ a FALSE - - 1 - 16 - FALSE - FALSE - 4 - 0,1,0,50 - 10 - FALSE - a - FALSE - - - 1 - 306 - FALSE - FALSE - 2 - 255,255 - 10 - FALSE - a - FALSE - - - 1 - 336 - FALSE - FALSE - 4 - 1,0,0,0 - 10 - FALSE - a - FALSE - - - 1 - 336 - FALSE - FALSE - 4 - 0,1,0,0 - 10 - FALSE - a - FALSE - - - 1 - 337 - FALSE - FALSE - 4 - 0,1,134,160 - 10 - FALSE - a - FALSE - - - 1 - 321 - FALSE - FALSE - 2 - 0,50 - 10 - FALSE - a - FALSE - - - 1 - 320 - FALSE - FALSE - 4 - 1,25,0,0 - 10 - FALSE - a - FALSE - From 57b19e59d963fe2e76dc3951b0b9e912d6fcbe97 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Fri, 1 Sep 2023 17:24:32 +0200 Subject: [PATCH 50/50] send params --- 306-controller_interface.X/app/can_message.c | 14 ++- .../nbproject/configurations.xml | 97 +++++++++++++++++++ 2 files changed, 107 insertions(+), 4 deletions(-) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 2e53ae4..72ff705 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -93,8 +93,11 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ KART_CST.STEERING_ALIVE_TIME = incomeData.separate.byte1; MEM_write_1_byte(MEMADD_DISPLAY_ALIVE_TIME, KART_CST.DISPLAY_ALIVE_TIME); MEM_write_1_byte(MEMADD_STEERING_ALIVE_TIME, KART_CST.STEERING_ALIVE_TIME); + // TODO set alive times - // TODO send params + // start alives + CM_DISPLAY_SETUP(NULL); + CM_STEERING_SETUP(NULL); } @@ -123,9 +126,10 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ MEM_write_1_byte(MEMADD_DRIVE_ALIVE_TIME, KART_CST.DRIVE_ALIVE_TIME); MEM_write_1_byte(MEMADD_DRIVE_SPEED_TIME, KART_CST.DRIVE_SPEED_TIME); MEM_write_1_byte(MEMADD_DRIVE_STOP_TIME, KART_CST.DRIVE_STOP_TIME); - ALIVE_setAliveTime(drive()->myChecker, KART_CST.DRIVE_ALIVE_TIME); + + ALIVE_setAliveTime(&drive()->myChecker, KART_CST.DRIVE_ALIVE_TIME); + ALIVE_emitStart(&drive()->myChecker, 0, 0); CM_DRIVE_SETUP(NULL); - // TODO send params } @@ -139,8 +143,10 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ MEM_write_1_byte(MEMADD_BATTERY_CURRENT_TIME, KART_CST.BATTERY_CURRENT_TIME); MEM_write_1_byte(MEMADD_BATTERY_ENERGY_TIME, KART_CST.BATTERY_ENERGY_TIME); MEM_write_1_byte(MEMADD_BATTERY_ALIVE_TIME, KART_CST.BATTERY_ALIVE_TIME); + // TODO set alive time - // TODO send params + // TODO start alive + CM_SUPPLY_SETUP(NULL); } diff --git a/306-controller_interface.X/nbproject/configurations.xml b/306-controller_interface.X/nbproject/configurations.xml index ac746da..2d248e4 100644 --- a/306-controller_interface.X/nbproject/configurations.xml +++ b/306-controller_interface.X/nbproject/configurations.xml @@ -210,18 +210,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +