Clean project

dev
Oleg 2 weeks ago
parent 0d2ff901a0
commit 792b62f9af

@ -63,10 +63,10 @@
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE.1199364549" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE" valueType="definedSymbols"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug.1740732058" name="C2000 Linker" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE.2028631359" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE" value="0x100" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE.2028631359" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.STACK_SIZE" value="0x400" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE.597993219" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.MAP_FILE" value="${ProjName}.map" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE.586191225" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.HEAP_SIZE.456913619" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.HEAP_SIZE" value="0x100" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.HEAP_SIZE.456913619" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.HEAP_SIZE" value="0x400" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY.1011420011" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.linkerID.LIBRARY" valueType="libs">
<listOptionValue value="libc.a"/>
<listOptionValue value="rts2800_fpu32_fast_supplement.lib"/>

@ -93,7 +93,12 @@ void Periphery::receiveModbusParameters(){
MODBUSRTU::modbusConfiguration.config.stopbits = static_cast<DSP28335::SCIStopBits>(_message.mdh.byte.BYTE5);
modbusRTU.configure(MODBUSRTU::modbusConfiguration);
// Future needs (maybe)
// Some bits are set before initialization process completed (CPU already at work for example).
// They should be reset for not to get false interrupt
// ECanaRegs.CANAA.all = 0xFFFFFFFF;
_modbusRegCounter = 0;
}
}
@ -125,6 +130,10 @@ void Periphery::getModbusConfiguration(){
}
}
_cana.disableTimeOutControl(can_space::MODBUS_SETTINGS_MBOX);
// Future needs (maybe)
// Some bits are set before initialization process completed (CPU already at work for example).
// They should be reset for not to get false interrupt
// ECanaRegs.CANAA.all = 0xFFFFFFFF;
_cana.receiveMsg(can_space::MODBUS_SETTINGS_MBOX, _message);
@ -197,7 +206,7 @@ void Periphery::receiveCpuModbusData(){
}
void Periphery::canInterruptHandle(){
void Periphery::canSystemInterruptHandle(){
_cana.busErrorInterruptFlagsReset();
_error = true;
}

@ -36,7 +36,7 @@ public:
void sendModbusDataToCPU();
void receiveCpuModbusData();
void canInterruptHandle();
void canSystemInterruptHandle();
private:
can_space::CAN _cana;

@ -1,15 +1,8 @@
// Some comments about author
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "DSP2833x_Device.h"
#include "DSP28x_Project.h" // Device Headerfile and Examples Include File
#include "DSP2833x_Examples.h"
// #include "Protocol/CAN.h"
// #include "Protocol/CAN_data.h"
// #include "Protocol/DigitalIO.h"
#include "Periphery.h"
#include "System/SystemContol.h"
@ -23,24 +16,12 @@ void idle_loop(void);
interrupt void cpu_timer0_isr(void);
interrupt void cpu_timer1_isr(void);
interrupt void cana_isr(void);
interrupt void cana_box_isr(void);
Periphery periphery;
volatile Uint16 infCounter = 0;
volatile Uint16 canISRcounter = 0;
volatile Uint16 canBoxISRcounter = 0;
volatile Uint16 testCounter = 0;
volatile bool init = true;
volatile bool startTX = false;
volatile bool update = false;
volatile bool sendRemote = false;
Uint16 modbusInit = 0;
int32 testVar = 0;
float test = 55;
volatile uint16_t infCounter = 0;
volatile uint16_t canISRcounter = 0;
volatile uint16_t canBoxISRcounter = 0;
void main()
{
@ -103,11 +84,9 @@ void idle_loop()
while (true)
{
infCounter++;
periphery.receiveModbusParameters();
periphery.modbusRTU.execute();
periphery.receiveCpuModbusData();
}//end while
@ -121,7 +100,7 @@ interrupt void cpu_timer0_isr(void)
periphery.sendModbusDataToCPU();
PieCtrlRegs.PIEACK.all |= PIEACK_GROUP1;
}//end
}
interrupt void cpu_timer1_isr(){
@ -134,36 +113,7 @@ interrupt void cpu_timer1_isr(){
interrupt void cana_isr(void){
canISRcounter++;
periphery.canInterruptHandle();
PieCtrlRegs.PIEACK.all |= PIEACK_GROUP9;
}
interrupt void cana_box_isr(void){
canBoxISRcounter++;
// Just example
//
// volatile Uint32 boxNumberIsr;
// boxNumberIsr = ECanbRegs.CANGIF1.bit.MIV1;
// CANRMP_REG temp;
// temp.all = 0;
// temp.all = 1ul << 27;
// ECanbRegs.CANRMP.all = temp.all;
// MODBUS_COMM_CPU_Message27.mdh.all = ECanbMboxes.MBOX27.MDH.all;
// MODBUS_COMM_CPU_Message27.mdl.all = ECanbMboxes.MBOX27.MDL.all;
// temp.all = ECanbRegs.CANRMP.all;
// if (temp.bit.RMP25){
// temp.all = 1ul << 25;
// ECanbRegs.CANRMP.all = temp.all;
// MODBUS_COMM_CPU_Message25.mdh.all = ECanbMboxes.MBOX25.MDH.all;
// MODBUS_COMM_CPU_Message25.mdl.all = ECanbMboxes.MBOX25.MDL.all;
// }
periphery.canSystemInterruptHandle();
PieCtrlRegs.PIEACK.all |= PIEACK_GROUP9;
}

Loading…
Cancel
Save