diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-16 13:30:16 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-16 13:30:16 +0300 |
| commit | 081feb3a75a5aa9eb30ce9bf6f4f279de30f8335 (patch) | |
| tree | 93904958b607e96d6cafeaf7655079fe0f41c255 /Software/Embedded_SW/Embedded | |
| parent | 013c584cf6dcf1dd61fa52f5841f500a4bfee459 (diff) | |
| download | Tango-081feb3a75a5aa9eb30ce9bf6f4f279de30f8335.tar.gz Tango-081feb3a75a5aa9eb30ce9bf6f4f279de30f8335.zip | |
reduce motorconfig size. remove graphic lib. alarm handling does not stop the job
Diffstat (limited to 'Software/Embedded_SW/Embedded')
55 files changed, 425 insertions, 1514 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index af6ec942d..74c64b8b5 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -79,14 +79,6 @@ byte index = 0; void receive_callback(char* buffer, size_t length) { - //SendChars(buffer,length); - //draw_string(buffer, length); - //draw_image((uint8_t *)buffer); - - //writeLine("Received "); - //writeFloat(length); - //writeString(" bytes"); - //writeLine("Parsing message..."); MessageContainer* requestContainer = message_container__unpack(NULL, length, (uint8_t*)buffer); // HeatingTestSendResonse(0, false,true,true, /*OriginalMotorSpd_2PPS[index]*/length,requestContainer->type,0,0, "Container"); diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index 6e8321edc..f5c4f0a98 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -4,6 +4,7 @@ #include <stdlib.h> #include <stdint.h> #include <stdbool.h> +#include <driverlib/gpio.h> //#define EVALUATION_BOARD // to use the LCD only when using the evaluation board //#define USE_USB @@ -123,6 +124,30 @@ enum #define MASK_LOW_BYTE_IN_WORD 0x00FF; #define MASK_HIGH_BYTE_IN_WORD 0xFF00; + +#define STATUS_GREEN_LED_ON ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, GPIO_PIN_1) //Turn ON STATUS Green LED +#define STATUS_RED_LED_ON ROM_GPIOPinWrite(GPIO_PORTS_BASE, GPIO_PIN_0, GPIO_PIN_0) //Turn ON STATUS Red LED + +#define ACTIVITY_RED_LED_ON ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_PIN_0) //Turn ON ACTIVITY Red LED +#define ACTIVITY_GREEN_LED_ON ROM_GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_0, GPIO_PIN_0) //Turn ON ACTIVITY Green LED + +#define COMM_RED_LED_ON ROM_GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_4, GPIO_PIN_4) //Turn ON COMM Red LED +#define COMM_GREEN_LED_ON ROM_GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_1, GPIO_PIN_1) //Turn ON COMM Green LED + +#define STATUS_GREEN_LED_OFF ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, 0) //Turn OFF STATUS Green LED +#define STATUS_RED_LED_OFF ROM_GPIOPinWrite(GPIO_PORTS_BASE, GPIO_PIN_0, 0) //Turn OFF STATUS Red LED + +#define ACTIVITY_RED_LED_OFF ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, 0) //Turn OFF ACTIVITY Red LED +#define ACTIVITY_GREEN_LED_OFF ROM_GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_0, 0) //Turn OFF ACTIVITY Green LED + +#define COMM_RED_LED_OFF ROM_GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_4, 0) //Turn OFF Red LED LED +#define COMM_GREEN_LED_OFF ROM_GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_1, 0) //Turn OFF COMM Green LED + +#define STATUS_GREEN_LED_CHANGE_MODE ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, (ROM_GPIOPinRead(GPIO_PORTN_BASE, GPIO_PIN_1) ^ GPIO_PIN_1)); +#define ACTIVITY_RED_LED_CHANGE_MODE ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, (ROM_GPIOPinRead(GPIO_PORTN_BASE, GPIO_PIN_0) ^ GPIO_PIN_0)); +#define COMM_RED_CHANGE_MODE ROM_GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_4, (ROM_GPIOPinRead(GPIO_PORTP_BASE, GPIO_PIN_4) ^ GPIO_PIN_4)); + + #define BIT0 0x0001 //0x01 << 0 #define BIT1 0x0002 //0x01 << 1 #define BIT2 0x0004 //0x01 << 2 diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c index 26b1dbae7..ba9fbc896 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c @@ -5,12 +5,13 @@ #include "driverlib/epi.h" #include "inc/hw_memmap.h" +#include <driverlib/gpio.h> #include "FPGA_COMM.h" #include "driverlib/sysctl.h" //for SysCtlDelay #include <driverlib/sysctl.h> #include <DataDef.h> -#include "Drivers/Peripheral_GPIO/GPIO.h" + unsigned short GPO_01_Reg; diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index 0face2b97..537bacea0 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -378,7 +378,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) break; case MOTOR_CONFIG_MIN_SPEED: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_lowspeedoptimization) + if(MotorsCfg[_motorId].lowspeedoptimization!=0) { temp = x_SET_PARAM | x_MIN_SPEED; temp = temp << 24; @@ -398,7 +398,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) break; case MOTOR_CONFIG_STEP_MODE: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_microstep) + if(MotorsCfg[_motorId].microstep!=0) { for (i = 0; i < 8; i++) { @@ -419,7 +419,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_CONFIG: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_configword) + if(MotorsCfg[_motorId].configword!=0) { temp = x_SET_PARAM | x_CONFIG; temp = temp << 24; @@ -429,7 +429,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_KVAL_HOLD: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_kvalhold) + if(MotorsCfg[_motorId].kvalhold!=0) { temp = x_SET_PARAM | x_KVAL_HOLD; temp = temp << 24; @@ -439,7 +439,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_KVAL_RUN: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_kvalrun) + if(MotorsCfg[_motorId].kvalrun!=0) { temp = x_SET_PARAM | x_KVAL_RUN; temp = temp << 24; @@ -449,7 +449,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_KVAL_ACC: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_kvalacc) + if(MotorsCfg[_motorId].kvalacc!=0) { temp = x_SET_PARAM | x_KVAL_ACC; temp = temp << 24; @@ -459,7 +459,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_KVAL_DEC: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_kvalacc)// dec is always the same as acc + if(MotorsCfg[_motorId].kvalacc!=0)// dec is always the same as acc { temp = x_SET_PARAM | x_KVAL_DEC; temp = temp << 24; @@ -469,7 +469,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_ST_SLP: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_stslp) + if(MotorsCfg[_motorId].stslp!=0) { temp = x_SET_PARAM | x_ST_SLP; temp = temp << 24; @@ -479,7 +479,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_INT_SPD: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_intspd) + if(MotorsCfg[_motorId].intspd!=0) { temp = x_SET_PARAM | x_INT_SPD; temp = temp << 24; @@ -489,7 +489,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_FN_SLP_ACC: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_fnslpacc) + if(MotorsCfg[_motorId].fnslpacc!=0) { temp = x_SET_PARAM | x_FN_SLP_ACC; temp = temp << 24; @@ -499,7 +499,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_FN_SLP_DEC: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_fnslpdec) + if(MotorsCfg[_motorId].fnslpdec!=0) { temp = x_SET_PARAM | x_FN_SLP_DEC; temp = temp << 24; @@ -509,7 +509,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_OCD_TH: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_overcurrentthreshold) + if(MotorsCfg[_motorId].overcurrentthreshold!=0) { temp = x_SET_PARAM | x_OCD_TH; temp = temp << 24; @@ -519,7 +519,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_STALL_TH: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_stallthreshold) + if(MotorsCfg[_motorId].stallthreshold!=0) { temp = x_SET_PARAM | x_STALL_TH; temp = temp << 24; @@ -529,7 +529,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_K_THERM: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_thermalcompensationfactor) + if(MotorsCfg[_motorId].thermalcompensationfactor!=0) { temp = x_SET_PARAM | x_K_THERM; temp = temp << 24; @@ -539,7 +539,7 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) } case MOTOR_CONFIG_FS_SPD: ConfigStages[_motorId]++; - if(MotorsCfg[_motorId].has_fsspd)//temporary using kvaldec for x_FS_SPD + if(MotorsCfg[_motorId].fsspd!=0)//temporary using kvaldec for x_FS_SPD { temp = x_SET_PARAM | x_FS_SPD; temp = temp << 24; diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/Moters_Driver/L6470.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/Moters_Driver/L6470.c index a39a6b991..cd0b09b93 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/Moters_Driver/L6470.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/Moters_Driver/L6470.c @@ -455,8 +455,6 @@ unsigned long ParamHandler(byte param, unsigned long value) // NOT provide direction information. case x_SPEED: ret_val = Param(0, 32); -// writeLine("ParamHandler: "); -// writeFloat(ret_val); break; // ACC and DEC set the acceleration and deceleration rates. Set ACC to 0xFFF // to get infinite acceleration/decelaeration- there is no way to get infinite diff --git a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c index a0aedfd3e..944abb737 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c +++ b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/Flash_Memory.c @@ -32,7 +32,7 @@ #include "driverlib/udma.h" #include "utils/uartstdio.h" #include "third_party/fatfs/src/ff.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "include.h" #include <drivers/Flash_Memory/Flash_Memory.h> #include <DataDef.h> @@ -492,9 +492,6 @@ int Init_Ext_Flash()//for the main board SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000); - // Display the setup on the console. - writeLine("SSI3 To DK-TM4C129 FLASH TRANSFER"); - // The SSI3 peripheral must be enabled for use. SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3); @@ -607,26 +604,16 @@ int Read_Ext_Flash_Device_ID() ui32DeviceID = SSILibSendReadIDAdvMode(SSI3_BASE); if(ui32DeviceID != 0xC219) { - writeLine("No External Flash... Read Back:"); - writeFloat(ui32DeviceID); while(1); } - writeLine("External Flash Detected with Device ID:"); - writeFloat(ui32DeviceID); - return 0; } int Erase_Sector_before_writting_To_Ext_Flash(uint32_t ui32Address) { - writeLine("Starting Erase Operations..."); - - SSILibSendEraseCommand(SSI3_BASE,ui32Address,INS_SECTOR_ERASE_4KB); - writeLine("Erase Completed..."); - return 0; } @@ -635,8 +622,6 @@ int Write_Words_To_Ext_Flash(uint32_t ui32Address, uint32_t NumOfWords, uint32_t uint32_t ui32Index; - writeLine("Starting Write Operations..."); - SSILibSendPageProgram(SSI3_BASE,ui32Address,INS_PAGE_PROGRAM); for(ui32Index=0;ui32Index<NumOfWords-1;ui32Index++) @@ -646,8 +631,6 @@ int Write_Words_To_Ext_Flash(uint32_t ui32Address, uint32_t NumOfWords, uint32_t SSIAdvDataPutFrameEnd(SSI3_BASE,TxBuf[NumOfWords-1]); - writeLine("Write Completed..."); - return 0; } @@ -656,8 +639,6 @@ int Read_Words_From_Ext_Flash(uint32_t ui32Address, uint32_t NumOfWords, uint32_ uint32_t ui32Index; - writeLine("Starting Read Operations..."); - SSILibSendReadDataAdvBi(SSI3_BASE,ui32Address,INS_READ_DATA); for(ui32Index=0;ui32Index<NumOfWords-1;ui32Index++) @@ -668,14 +649,13 @@ int Read_Words_From_Ext_Flash(uint32_t ui32Address, uint32_t NumOfWords, uint32_ SSIAdvDataPutFrameEnd(SSI3_BASE,DUMMY_BYTE); SSIDataGet(SSI3_BASE,&RxBuf[NumOfWords-1]); - writeLine("Read Completed..."); - return 0; } int Display_RX_TX_Ext_Flash_Data(uint32_t NumOfWords, uint32_t* TxBuf, uint32_t* RxBuf) { uint32_t ui32Index; +#ifdef SPI_EVA_LCD_ENABLED for(ui32Index=0;ui32Index<NumOfWords;ui32Index++) { @@ -694,7 +674,7 @@ int Display_RX_TX_Ext_Flash_Data(uint32_t NumOfWords, uint32_t* TxBuf, uint32_t* writeFloat(RxBuf[ui32Index]); } } - +#endif return 0; } diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c b/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c index bb31e502c..2b132955a 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c +++ b/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c @@ -20,7 +20,7 @@ #include <drivers/FPGA/FPGA_Comm.h> #include <DataDef.h> -#include "Drivers/Peripheral_GPIO/GPIO.h" + #include <Modules/Stubs_Handler/User_Leds.h> #include "PMR/Hardware/HardwarePIDControl.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h index ee717ef24..5c0729f69 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h @@ -47,42 +47,36 @@ // double hightimeoutusec; //}MotorDriverConfigStruc; -/*typedef struct +typedef struct { - uint32_t ACC; //set - uint32_t DEC; //set - uint32_t MaxSpeed; //set - bool HasMicroStep; - uint32_t Microstep; //set - bool HasConfigWord; - uint16_t ConfigWord; //set - bool has_kvalhold; + HardwareMotorType hardwaremotortype; + int32_t minfrequency; + int32_t maxfrequency; + int32_t setmicrostep; + int32_t microstep; + double maxchangeslope; + double highlengthmicrosecond; + bool speedmaster; + int32_t pulseperround; + double pulleyradius; + int32_t configword; + bool directionthreadwize; int32_t kvalhold; - bool has_kvalrun; int32_t kvalrun; - bool has_kvalacc; int32_t kvalacc; - bool has_kvaldec; int32_t kvaldec; - bool has_overcurrentthreshold; int32_t overcurrentthreshold; - bool has_stallthreshold; int32_t stallthreshold; - bool has_thermalcompensationfactor; int32_t thermalcompensationfactor; - bool has_lowspeedoptimization; bool lowspeedoptimization; - bool has_stslp; int32_t stslp; - bool has_intspd; int32_t intspd; - bool has_fnslpacc; int32_t fnslpacc; - bool has_fnslpdec; int32_t fnslpdec; + int32_t fsspd; }MotorDriverConfigStruc; -*/ -#define MotorDriverConfigStruc HardwareMotor + +//#define MotorDriverConfigStruc HardwareMotor typedef struct { bool Direction; @@ -107,7 +101,7 @@ extern MotorDriverRequestStruct MotorDriverRequest[NUM_OF_MOTORS]; extern MotorDriverResponseStruct MotorDriverResponse[NUM_OF_MOTORS]; -extern HardwareMotor MotorsCfg[NUM_OF_MOTORS]; +extern MotorDriverConfigStruc MotorsCfg[NUM_OF_MOTORS]; //initialize general motors driver database uint32_t MotorsInit(void); diff --git a/Software/Embedded_SW/Embedded/Drivers/Peripheral_GPIO/GPIO.c b/Software/Embedded_SW/Embedded/Drivers/Peripheral_GPIO/GPIO.c deleted file mode 100644 index 6bc348701..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/Peripheral_GPIO/GPIO.c +++ /dev/null @@ -1,133 +0,0 @@ - -#include <stdbool.h> -#include <ti/sysbios/BIOS.h> -#include <driverlib/rom.h> -#include <inc/hw_memmap.h> -#include "Drivers/Peripheral_GPIO/GPIO.h" - -//#define MAX_NUM_OF_REGISTRED_CALLBACKS 9 // screw,6 dispensers , 2 sw - start manual/stop manual -#define MAX_NUM_OF_REGISTRED_CALLBACKS 7 // screw,6 dispensers , 2 sw - start manual/stop manual - -typedef struct -{ - uint32_t m_port; - uint32_t m_pin; -} GPIOIntPortMap; - -static GPIOIntPortMap portMap[NUM_OF_GPIO_INT] = -{ -#ifdef EVALUATION_BOARD - {GPIO_PORTG_BASE, GPIO_INT_PIN_0}, // Dispenser LSW 1 - {GPIO_PORTG_BASE, GPIO_INT_PIN_1}, // Dispenser LSW 2 - {GPIO_PORTP_BASE, GPIO_INT_PIN_4}, // Dispenser LSW 3 - {GPIO_PORTP_BASE, GPIO_INT_PIN_5}, // Dispenser LSW 4 - {GPIO_PORTQ_BASE, GPIO_INT_PIN_7}, // Dispenser LSW 5 - {GPIO_PORTS_BASE, GPIO_INT_PIN_0}, // Dispenser LSW 6 - {GPIO_PORTS_BASE, GPIO_INT_PIN_3}, // Screw LSW - {GPIO_PORTD_BASE, GPIO_INT_PIN_1}, // Start Manual Btn - {GPIO_PORTJ_BASE, GPIO_INT_PIN_3}, // End Manual Btn - {GPIO_PORTE_BASE, GPIO_INT_PIN_4}, // - {GPIO_PORTH_BASE, GPIO_INT_PIN_5}, // - {GPIO_PORTP_BASE, GPIO_INT_PIN_0}, // - {GPIO_PORTQ_BASE, GPIO_INT_PIN_5}, // -#endif -}; - -typedef struct -{ - bool m_isEnabled; - GPIOInt_t m_param; - GPIOIntCallback m_callback; -}PortConfig_t; - -static PortConfig_t gpio_configuration[MAX_NUM_OF_REGISTRED_CALLBACKS]; - -bool PollGPIO (uint8_t index) -{ - unsigned long ulStatus = ROM_GPIOPinRead(portMap[index].m_port, portMap[index].m_pin); - if ( ulStatus) - { - return true; - } - return false; -} -//******************************************************************************************************************** -//genneral interrupt handler for all GPIO's -//******************************************************************************************************************** -void IntGPIO(UArg arg0) -{ - uint32_t port = (uint32_t)arg0; - unsigned long ulStatus = ROM_GPIOIntStatus(port, true); - - - uint8_t index; - for (index = 0; index < MAX_NUM_OF_REGISTRED_CALLBACKS; ++index) - { - GPIOInt_t gpioInt = gpio_configuration[index].m_param; - if (gpio_configuration[index].m_isEnabled && (portMap[gpioInt].m_port == port) && (portMap[gpioInt].m_pin & ulStatus)) - { - gpio_configuration[index].m_callback(gpio_configuration[index].m_param); - } - } - // - // Clear all the pin interrupts that are set - // - ROM_GPIOIntClear(port, ulStatus); -} - -//******************************************************************************************************************** -void GPIOInit(void) -{ - uint8_t index; - for (index = 0; index < MAX_NUM_OF_REGISTRED_CALLBACKS; ++index) - { - gpio_configuration[index].m_isEnabled = false; - } -} - -//******************************************************************************************************************** -void GPIOEnableInterrupt(GPIOInt_t gpioInt, GPIOIntCallback callBack, uint32_t type) -{ - uint8_t index; - for (index = 0; index < MAX_NUM_OF_REGISTRED_CALLBACKS; ++index) - { - if (!gpio_configuration[index].m_isEnabled) - { - gpio_configuration[index].m_isEnabled = true; - gpio_configuration[index].m_param = gpioInt; - gpio_configuration[index].m_callback = callBack; - ROM_GPIOIntTypeSet(portMap[gpioInt].m_port,portMap[gpioInt].m_pin, type); - ROM_GPIOIntClear(portMap[gpioInt].m_port,portMap[gpioInt].m_pin); - ROM_GPIOIntEnable(portMap[gpioInt].m_port,portMap[gpioInt].m_pin); - return; - } - else - { - if ((gpio_configuration[index].m_param == gpioInt) && - (gpio_configuration[index].m_callback == callBack)) - { - return; - } - } - } -} - -//******************************************************************************************************************** - -void GPIODisableInterrupt(GPIOInt_t gpioInt,GPIOIntCallback callBack) -{ - uint8_t index; - for (index = 0; index < MAX_NUM_OF_REGISTRED_CALLBACKS; ++index) - { - if (gpio_configuration[index].m_isEnabled && - (gpio_configuration[index].m_param == gpioInt) && - (gpio_configuration[index].m_callback == callBack)) - { - ROM_GPIOIntDisable(portMap[gpioInt].m_port,portMap[gpioInt].m_pin); - ROM_GPIOIntClear(portMap[gpioInt].m_port,portMap[gpioInt].m_pin); - gpio_configuration[index].m_isEnabled = false; - return; - } - } -} - diff --git a/Software/Embedded_SW/Embedded/Drivers/Peripheral_GPIO/GPIO.h b/Software/Embedded_SW/Embedded/Drivers/Peripheral_GPIO/GPIO.h deleted file mode 100644 index 66e99375d..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/Peripheral_GPIO/GPIO.h +++ /dev/null @@ -1,199 +0,0 @@ - -#ifndef DRIVERS_GPIO_H_ -#define DRIVERS_GPIO_H_ - -#include <stdint.h> -#include <stdbool.h> -#include <driverlib/gpio.h> - -typedef enum -{ - GPI001_LS_DH_CLEAN_DOWN, - GPI002_LS_DH_CLEAN_LEFT, - GPI003_LS_DH_CLEAN_RIGHT, - GPI004_LS_DH_CLEAN_UP, - GPI005_LS_DH_LID_CLEANING, - GPI006_LS_DH_LID_CLOSED, - GPI007_LS_DH_LID_OPEN, - GPI008_LS_DH_SPARE1, - GPI009_LS_DRYER_LID_CLOSED, - GPI010_LS_DRYER_LID_OPEN, - GPI011_LS_DRYER_SPARE1, - GPI012_LS_DRYER_SPARE2, - GPI013_LS_DRYER_SPARE3, - GPI014_LS_DRYER_SPARE4, - GPI015_LS_LOADARM_LEFT, - GPI016_LS_LOADARM_RIGHT, - GPI017_GPI_PS1_DC_OK, - GPI018_GPI_PANSW1, - GPI019_GPI_PANSW2, - GPI020_GPI_PANSW3, - GPI021_GPI_PANSW4, - GPI022_GPI_PANSW5, - GPI023_GPI_PANSW6, - GPI024_GPI_PWRBUTTON, - GPI025_GPI_TACTSW1, - GPI026_GPI_TACTSW2, - GPI027_GPI_TACTSW3, - GPI028_GPI_TACTSW4, - GPI029_GPI_EXTWINDER_1, - GPI030_GPI_EXTWINDER_2, - GPI031_GPI_EXTWINDER_3, - GPI032_LS_DISPENSER_25_1, - GPI033_LS_DISPENSER_25_2, - GPI034_LS_DISPENSER_25_3, - GPI035_LS_DISPENSER_25_4, - GPI036_LS_DISPENSER_25_5, - GPI037_LS_DISPENSER_25_6, - GPI038_LS_DISPENSER_25_7, - GPI039_LS_DISPENSER_25_8, - GPI040_LS_DISPENSER_50_1, - GPI041_LS_DISPENSER_50_2, - GPI042_LS_DISPENSER_50_3, - GPI043_LS_DISPENSER_50_4, - GPI044_LS_DISPENSER_50_5, - GPI045_LS_DISPENSER_50_6, - GPI046_LS_DISPENSER_50_7, - GPI047_LS_DISPENSER_50_8, - GPI048_LS_DISPENSER_75_1, - GPI049_LS_DISPENSER_75_2, - GPI050_LS_DISPENSER_75_3, - GPI051_LS_DISPENSER_75_4, - GPI052_LS_DISPENSER_75_5, - GPI053_LS_DISPENSER_75_6, - GPI054_LS_DISPENSER_75_7, - GPI055_LS_DISPENSER_75_8, - GPI056_LS_DISPENSER_DOWN_1, - GPI057_LS_DISPENSER_DOWN_2, - GPI058_LS_DISPENSER_DOWN_3, - GPI059_LS_DISPENSER_DOWN_4, - GPI060_LS_DISPENSER_DOWN_5, - GPI061_LS_DISPENSER_DOWN_6, - GPI062_LS_DISPENSER_DOWN_7, - GPI063_LS_DISPENSER_DOWN_8, - GPI064_LS_DISPENSER_SPARE_1, - GPI065_LS_DISPENSER_SPARE_2, - GPI066_LS_DISPENSER_SPARE_3, - GPI067_LS_DISPENSER_SPARE_4, - GPI068_LS_DISPENSER_SPARE_5, - GPI069_LS_DISPENSER_SPARE_6, - GPI070_LS_DISPENSER_SPARE_7, - GPI071_LS_DISPENSER_SPARE_8, - GPI072_LS_DISPENSER_UP_1, - GPI073_LS_DISPENSER_UP_2, - GPI074_LS_DISPENSER_UP_3, - GPI075_LS_DISPENSER_UP_4, - GPI076_LS_DISPENSER_UP_5, - GPI077_LS_DISPENSER_UP_6, - GPI078_LS_DISPENSER_UP_7, - GPI079_LS_DISPENSER_UP_8, - GPI080_MIDTANK1_LVL1_FLOAT, - GPI081_MIDTANK1_LVL2_FLOAT, - GPI082_MIDTANK1_LVL3_FLOAT, - GPI083_MIDTANK1_LVL4_FLOAT, - GPI084_MIDTANK2_LVL1_FLOAT, - GPI085_MIDTANK2_LVL2_FLOAT, - GPI086_MIDTANK2_LVL3_FLOAT, - GPI087_MIDTANK2_LVL4_FLOAT, - GPI088_MIDTANK3_LVL1_FLOAT, - GPI089_MIDTANK3_LVL2_FLOAT, - GPI090_MIDTANK3_LVL3_FLOAT, - GPI091_MIDTANK3_LVL4_FLOAT, - GPI092_MIDTANK4_LVL1_FLOAT, - GPI093_MIDTANK4_LVL2_FLOAT, - GPI094_MIDTANK4_LVL3_FLOAT, - GPI095_MIDTANK4_LVL4_FLOAT, - GPI096_MIDTANK5_LVL1_FLOAT, - GPI097_MIDTANK5_LVL2_FLOAT, - GPI098_MIDTANK5_LVL3_FLOAT, - GPI099_MIDTANK5_LVL4_FLOAT, - GPI100_MIDTANK6_LVL1_FLOAT, - GPI101_MIDTANK6_LVL2_FLOAT, - GPI102_MIDTANK6_LVL3_FLOAT, - GPI103_MIDTANK6_LVL4_FLOAT, - GPI104_MIDTANK7_LVL1_FLOAT, - GPI105_MIDTANK7_LVL2_FLOAT, - GPI106_MIDTANK7_LVL3_FLOAT, - GPI107_MIDTANK7_LVL4_FLOAT, - GPI108_MIDTANK8_LVL1_FLOAT, - GPI109_MIDTANK8_LVL2_FLOAT, - GPI110_MIDTANK8_LVL3_FLOAT, - GPI111_MIDTANK8_LVL4_FLOAT, - GPI112_LS_SCREW_LEFT, - GPI113_LS_SCREW_RIGHT, - GPI114_SW_SPARE, - GPI115_SW_SPOOL_EXISTS, - GPI116_LS_LDANCER1_DOWN, - GPI117_LS_LDANCER1_UP, - GPI118_LS_LDANCER2_DOWN, - GPI119_LS_LDANCER2_UP, - GPI120_LS_LLOADMOTOR_DOWN, - GPI121_LS_LLOADMOTOR_UP, - GPI122_LS_LPIVOT_DOWN, - GPI123_LS_LPIVOT_UP, - GPI124_LS_LSPARE1, - GPI125_LS_LSPARE2, - GPI126_LS_PIVOT_SPARE1, - GPI127_LS_PIVOT_SPARE2, - GPI128_LS_RLOADMOTOR_UP, - GPI129_GPI_TFEED_BREAK_1, - GPI130_GPI_TFEED_BREAK_2, - GPI131_LS_RDANCER_DOWN, - GPI132_LS_RDANCER_UP, - GPI133_LS_RLOADMOTOR_DOWN, - GPI134_LS_RLOADRAM_DOWN, //F1_LS_RDANCER_LONG - GPI135_LS_RLOADRAM_UP, - GPI136_LS_RSPARE1, - GPI137_LS_RSPARE2, - GPI138_LS_SPARE1_1, - GPI139_LS_SPARE1_2, - GPI140_LS_SPARE1_3, - GPI141_LS_SPARE1_4, - GPI142_LS_SPARE2_1, - GPI143_LS_SPARE2_2, - GPI144_LS_SPARE2_3, - GPI145_LS_SPARE2_4, - GPI146_GPI_AIRFLOW_FLAP, - GPI147_GPI_BLOWER_TACH, - GPI148_GPI_CHILLER_FAULT, - GPI149_GPI_CHILLER_STAT1, - GPI150_GPI_SW_FILTER_PRES, - GPI151_GPI_WCONTAINER_FULL, - GPI152_GPI_WCONTAINER_WARN, - NUM_OF_GPIO_INT -}GPIOInt_t; - - -#define STATUS_GREEN_LED_ON ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, GPIO_PIN_1) //Turn ON STATUS Green LED -#define STATUS_RED_LED_ON ROM_GPIOPinWrite(GPIO_PORTS_BASE, GPIO_PIN_0, GPIO_PIN_0) //Turn ON STATUS Red LED - -#define ACTIVITY_RED_LED_ON ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_PIN_0) //Turn ON ACTIVITY Red LED -#define ACTIVITY_GREEN_LED_ON ROM_GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_0, GPIO_PIN_0) //Turn ON ACTIVITY Green LED - -#define COMM_RED_LED_ON ROM_GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_4, GPIO_PIN_4) //Turn ON COMM Red LED -#define COMM_GREEN_LED_ON ROM_GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_1, GPIO_PIN_1) //Turn ON COMM Green LED - -#define STATUS_GREEN_LED_OFF ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, 0) //Turn OFF STATUS Green LED -#define STATUS_RED_LED_OFF ROM_GPIOPinWrite(GPIO_PORTS_BASE, GPIO_PIN_0, 0) //Turn OFF STATUS Red LED - -#define ACTIVITY_RED_LED_OFF ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, 0) //Turn OFF ACTIVITY Red LED -#define ACTIVITY_GREEN_LED_OFF ROM_GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_0, 0) //Turn OFF ACTIVITY Green LED - -#define COMM_RED_LED_OFF ROM_GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_4, 0) //Turn OFF Red LED LED -#define COMM_GREEN_LED_OFF ROM_GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_1, 0) //Turn OFF COMM Green LED - -#define STATUS_GREEN_LED_CHANGE_MODE ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_1, (ROM_GPIOPinRead(GPIO_PORTN_BASE, GPIO_PIN_1) ^ GPIO_PIN_1)); -#define ACTIVITY_RED_LED_CHANGE_MODE ROM_GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, (ROM_GPIOPinRead(GPIO_PORTN_BASE, GPIO_PIN_0) ^ GPIO_PIN_0)); -#define COMM_RED_CHANGE_MODE ROM_GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_4, (ROM_GPIOPinRead(GPIO_PORTP_BASE, GPIO_PIN_4) ^ GPIO_PIN_4)); - -typedef void (*GPIOIntCallback)(GPIOInt_t arg); - -void GPIOInit(void); - -bool PollGPIO (uint8_t index); - -void GPIOEnableInterrupt(GPIOInt_t gpioInt, GPIOIntCallback callBack, uint32_t type); - -void GPIODisableInterrupt(GPIOInt_t gpioInt,GPIOIntCallback callBack); - -#endif /* DRIVERS_GPIO_H_ */ diff --git a/Software/Embedded_SW/Embedded/Drivers/SPI/SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/SPI/SPI_Comm.c index 89319786d..80a1d15b2 100644 --- a/Software/Embedded_SW/Embedded/Drivers/SPI/SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/SPI/SPI_Comm.c @@ -335,9 +335,11 @@ void SPI_RX(unsigned int SSI_Bsae, uint32_t* RxBuf, uint32_t NumOfWords) // SSIDataGet(SSI_Bsae, &pui32DataRx[ui32Index]); + //#ifdef SPI_EVA_LCD_ENABLED // writeLine("SPI_RX: "); // writeFloat (pui32DataRx[ui32Index]); // writeString(" "); + //#endif // @@ -432,7 +434,7 @@ void setup(MotorDriverConfigStruc *MotorConfig) } } - if(MotorConfig->has_microstep) + if(MotorConfig->microstep !=0) { SetParam(x_STEP_MODE, !x_SYNC_EN | @@ -610,7 +612,7 @@ void setup(MotorDriverConfigStruc *MotorConfig) } */ - if(MotorConfig->has_configword) + if(MotorConfig->configword!=0) { //while(SSIBusy(SSI2_BASE)){}; timeout = SSI_SPI_TIMEOUT; @@ -640,7 +642,7 @@ void setup(MotorDriverConfigStruc *MotorConfig) return ; } } - if(MotorConfig->has_overcurrentthreshold) + if(MotorConfig->overcurrentthreshold!=0) { SetParam(x_OCD_TH, MotorConfig->overcurrentthreshold); } @@ -873,7 +875,6 @@ void loop() // SysCtlDelay(17500000); // HardStop(); - // writeLine("Received: "); //while(1) { @@ -882,8 +883,6 @@ void loop() // { // Run(FWD,i ); // HardStop(); -// writeLine("Tx "); -// writeFloat(i); // SysCtlDelay(5000000); // } //i = 100000; @@ -926,8 +925,6 @@ void loop() //Avi_test_get_speed(); //OK !!! Read_Speed = Get_Param(x_SPEED); -/* writeLine("Read_Speed: "); - writeFloat(Read_Speed);*/ //while(SSIBusy(SSI2_BASE)){}; timeout = SSI_SPI_TIMEOUT; @@ -942,9 +939,6 @@ void loop() } //SysCtlDelay(17500000); Read_pos = Get_Param(x_ABS_POS); - //writeLine("Read_pos: "); - //writeFloat(Read_pos); - // while(SSIBusy(SSI2_BASE)){}; timeout = SSI_SPI_TIMEOUT; while(SSIBusy(SSI2_BASE)) @@ -957,13 +951,9 @@ void loop() } /* Read_ELpos = Get_Param(x_EL_POS); - writeLine("Read_EL_pos: "); - writeFloat(Read_ELpos); while(SSIBusy(SSI2_BASE)){};*/ - //writeLine("Tx "); - //writeFloat(Run_Value); Run(Direction,Run_Value ); switch(Stop_Command) @@ -992,6 +982,7 @@ void loop() read_status = Get_Param(x_STATUS); /* +#ifdef SPI_EVA_LCD_ENABLED switch((read_status & x_STATUS_MOT_STATUS)>>5) { case 0://Stopped @@ -1016,23 +1007,18 @@ void loop() writeLine("<<"); break; } +#endif */ //read_status = GetStatus(); //read_status = Get_Param_Status( x_GET_STATUS); // The GetStatus command resets the STATUS register warning flags. read_status = Get_and_Clear_Status(); - if((read_status & x_STATUS_UVLO)==0) - //writeLine("Undervoltage"); Get_Param(x_STEP_MODE); /* //speed = Get_Param(x_SPEED); speed = GetParam(x_SPEED); - if(speed & 0xfffff == Run_Value ) - writeLine(" XXXXXXX "); - writeLine(" Speed: "); - writeFloat(speed); */ //SysCtlDelay(17500000); ///while(SSIBusy(SSI2_BASE)){}; @@ -1060,15 +1046,11 @@ void loop() Read_Acc = Get_Param(x_ACC); - writeLine("x_ACC: "); - writeFloat(Read_Acc); // while(SSIBusy(SSI2_BASE)){}; Read_Dec = Get_Param(x_DEC); - writeLine("x_ACC: "); - writeFloat(Read_Dec); while(SSIBusy(SSI2_BASE)){}; @@ -1096,30 +1078,20 @@ void loop() /* Read_KvalAcc = Get_Param(x_KVAL_ACC); - writeLine("x_KVAL_ACC: "); - writeFloat(Read_KvalAcc); Read_KvalDec = Get_Param(x_KVAL_DEC); - writeLine("x_KVAL_DEC: "); - writeFloat(Read_KvalDec); */ /* while (1) { //Run(Direction,Run_Value ); - writeLine("Tx "); - writeFloat(Run_Value); SysCtlDelay(7500000); Read_Speed = Get_Param(x_SPEED); - writeLine("Speed: "); - writeFloat(Read_Speed); SpeedStepPerSec = MaxSpdCalc(Read_Speed); - writeLine("Speed (Step Per Sec): "); - writeFloat(SpeedStepPerSec); } */ @@ -1138,14 +1110,10 @@ void loop() //SetParam(x_MAX_SPEED, MaxSpdCalc(1)); // Change the Speed // SetParam(x_MIN_SPEED, MinSpdCalc(300)); - //writeLine("Tx "); - // writeFloat(i); - // writeLine("Rx "); //delay(5); //SysCtlDelay(7500000); // need #include "driverlib/sysctl.h" //ReadSpeed = GetParam(x_SPEED); - //writeFloat(ReadSpeed); //SysCtlDelay(17500000); @@ -1210,8 +1178,6 @@ byte Transfer_tx(byte data/*, byte data_out*/ ) SPI_RX(SSI2_BASE, &pui32DataRx, NUM_SSI_DATA ); - //writeLine("Transfer_tx: "); - //writeFloat(pui32DataRx[0]); data_out = pui32DataRx[0]; diff --git a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.ccsproject b/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.ccsproject deleted file mode 100644 index d132942b2..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.ccsproject +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<?ccsproject version="1.0"?> -<projectOptions> - <ccsVersion value="7.2.0"/> - <deviceVariant value="Cortex M.TM4C129XNCZAD"/> - <deviceFamily value="TMS470"/> - <deviceEndianness value="little"/> - <codegenToolVersion value="16.3.0.STS"/> - <isElfFormat value="true"/> - <createSlaveProjects value=""/> - <templateProperties value="id=com.ti.common.project.core.emptyProjectTemplate,"/> - <filesToOpen value=""/> -</projectOptions> diff --git a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.cproject b/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.cproject deleted file mode 100644 index 670f72289..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.cproject +++ /dev/null @@ -1,141 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> - <storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings"> - <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.570777470"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.570777470" moduleId="org.eclipse.cdt.core.settings" name="Debug"> - <externalSettings/> - <extensions> - <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.570777470" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug"> - <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.570777470." name="/" resourcePath=""> - <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.libraryDebugToolchain.2032570844" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.libraryDebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug.2089916128"> - <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.471837303" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> - <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> - <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> - <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> - <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> - <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> - </option> - <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.14452932" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="16.3.0.STS" valueType="string"/> - <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformDebug.2077799957" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformDebug"/> - <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderDebug.1862617755" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderDebug"/> - <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerDebug.965069148" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerDebug"> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.1420295243" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.1973394165" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.16" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.1571358636" name="Application binary interface. (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.eabi" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.1058631933" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC.1533299340" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC" useByScannerDiscovery="false" value="true" valueType="boolean"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE.1304341340" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="ccs="ccs""/> - <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> - </option> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.1401917836" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING.1812174325" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> - <listOptionValue builtIn="false" value="225"/> - </option> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER.1748110206" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.515905302" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.off" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH.2081262530" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH" valueType="includePath"> - <listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/> - <listOptionValue builtIn="false" value=""${workspace_loc:/grlib}""/> - <listOptionValue builtIn="false" value=""${SW_ROOT}/examples/boards/dk-tm4c129x""/> - <listOptionValue builtIn="false" value=""${SW_ROOT}""/> - <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> - </option> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN.312422354" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN" useByScannerDiscovery="false" value="true" valueType="boolean"/> - <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS.77324950" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS"/> - <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS.679207486" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS"/> - <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS.61011931" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS"/> - <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS.804002552" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS"/> - </tool> - <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug.2089916128" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianDebug"> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE.1663408519" name="Output file" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE" useByScannerDiscovery="false" value=""${ProjName}.lib"" valueType="string"/> - </tool> - </toolChain> - </folderInfo> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - <cconfiguration id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2011248728"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2011248728" moduleId="org.eclipse.cdt.core.settings" name="Release"> - <externalSettings/> - <extensions> - <extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="lib" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2011248728" name="Release" parent="com.ti.ccstudio.buildDefinitions.TMS470.Release"> - <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Release.2011248728." name="/" resourcePath=""> - <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.ReleaseToolchain.270241411" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianRelease.226377319"> - <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.658988475" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> - <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.TM4C129XNCZAD"/> - <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> - <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> - <listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/> - <listOptionValue builtIn="false" value="OUTPUT_TYPE=staticLibrary"/> - </option> - <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1941138829" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="16.3.0.STS" valueType="string"/> - <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformRelease.573647717" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.targetPlatformRelease"/> - <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderRelease.1944619168" name="GNU Make.Release" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.builderRelease"/> - <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerRelease.494478037" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.compilerRelease"> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.48552291" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.SILICON_VERSION.7M4" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.1313168309" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.CODE_STATE.16" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.438530402" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.ABI.eabi" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.1147145429" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.FLOAT_SUPPORT.FPv4SPD16" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC.1045197456" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.GCC" useByScannerDiscovery="false" value="true" valueType="boolean"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE.1608793976" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEFINE" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="ccs="ccs""/> - <listOptionValue builtIn="false" value="PART_TM4C129XNCZAD"/> - </option> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING.547667799" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList"> - <listOptionValue builtIn="false" value="225"/> - </option> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER.422231554" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.266800110" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DIAG_WRAP.off" valueType="enumerated"/> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH.861179576" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.INCLUDE_PATH" valueType="includePath"> - <listOptionValue builtIn="false" value=""${PROJECT_ROOT}""/> - <listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> - </option> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN.1730997241" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.LITTLE_ENDIAN" useByScannerDiscovery="false" value="true" valueType="boolean"/> - <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS.2059150249" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__C_SRCS"/> - <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS.171152981" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__CPP_SRCS"/> - <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS.546362320" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM_SRCS"/> - <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS.558515027" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compiler.inputType__ASM2_SRCS"/> - </tool> - <tool id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianRelease.226377319" name="ARM Archiver" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.library.librarianRelease"> - <option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE.2104237110" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.archiverID.OUTPUT_FILE" useByScannerDiscovery="false" value=""${ProjName}.lib"" valueType="string"/> - </tool> - </toolChain> - </folderInfo> - </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <project id="twine_graphicslib.com.ti.ccstudio.buildDefinitions.TMS470.ProjectType.504498469" name="ARM" projectType="com.ti.ccstudio.buildDefinitions.TMS470.ProjectType"/> - </storageModule> - <storageModule moduleId="scannerConfiguration"/> - <storageModule moduleId="org.eclipse.cdt.core.language.mapping"> - <project-mappings> - <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/> - <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/> - <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/> - <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/> - <content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/> - </project-mappings> - </storageModule> -</cproject> diff --git a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.project b/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.project deleted file mode 100644 index 8736c1f5b..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.project +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>twine_graphicslib</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> - <triggers>full,incremental,</triggers> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>com.ti.ccstudio.core.ccsNature</nature> - <nature>org.eclipse.cdt.core.cnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> - <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> - </natures> - <linkedResources> - <link> - <name>drivers/frame.c</name> - <type>1</type> - <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/frame.c</locationURI> - </link> - <link> - <name>drivers/kentec320x240x16_ssd2119.c</name> - <type>1</type> - <locationURI>SW_ROOT/examples/boards/dk-tm4c129x/drivers/kentec320x240x16_ssd2119.c</locationURI> - </link> - </linkedResources> - <variableList> - <variable> - <name>SW_ROOT</name> - <value>$%7BTI_PRODUCTS_DIR%7D/TivaWare_C_Series-2.1.4.178</value> - </variable> - </variableList> -</projectDescription> diff --git a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.cdt.codan.core.prefs b/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index f653028c5..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -inEditor=false -onBuild=false diff --git a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.cdt.debug.core.prefs b/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.cdt.debug.core.prefs deleted file mode 100644 index 2adc7b1dd..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.cdt.debug.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker diff --git a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.core.resources.prefs b/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 3774f8b3e..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,8 +0,0 @@ -eclipse.preferences.version=1 -encoding//Debug/drivers/subdir_rules.mk=UTF-8 -encoding//Debug/drivers/subdir_vars.mk=UTF-8 -encoding//Debug/makefile=UTF-8 -encoding//Debug/objects.mk=UTF-8 -encoding//Debug/sources.mk=UTF-8 -encoding//Debug/subdir_rules.mk=UTF-8 -encoding//Debug/subdir_vars.mk=UTF-8 diff --git a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/graphics_adapter.c b/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/graphics_adapter.c deleted file mode 100644 index dde30df95..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/graphics_adapter.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * graphics_adapter.c - * - * Created on: Sep 24, 2017 - * Author: Roy - */ - -#include <stdbool.h> -#include <stdlib.h> -#include <stdint.h> -#include <string.h> -#include "graphics_adapter.h" -#include "grlib/grlib.h" -//#include "drivers/frame.h" -//#include "drivers/kentec320x240x16_ssd2119.h" - -#define LINE_HEIGHT 12 -#define MAX_POSITION 240 -int current_position = 0; -char current_line[100]; - -void init_graphics(uint32_t ui32SysClock) -{ -#ifdef USE_GRAPHICS - // Initialize the display driver. - Kentec320x240x16_SSD2119Init(ui32SysClock); - - // Initialize the graphics context. - GrContextInit(&g_sContext, &g_sKentec320x240x16_SSD2119); - - clear(); - -#endif -} - -void draw_image(uint8_t* data) -{ -#ifdef USE_GRAPHICS - GrImageDraw(&g_sContext, data, 0, 0); -#endif -} - -void draw_string(char* data, size_t length) -{ -#ifdef USE_GRAPHICS - tRectangle backRect; - backRect.i16XMin = 100; - backRect.i16XMax = 300; - backRect.i16YMin = 100; - backRect.i16YMax = 80; - - GrContextForegroundSet(&g_sContext, ClrBlack); - GrRectFill(&g_sContext, &backRect); - - - GrStringDraw(&g_sContext, data, length, 0, 0, true); -#endif -} - -void writeLine(char* text) -{ -#ifdef USE_GRAPHICS - if (current_position >= MAX_POSITION) - { - clear(); - } - - strcpy(current_line, text); - GrStringDraw(&g_sContext, current_line, strlen(current_line), 0, current_position, true); - current_position += LINE_HEIGHT; -#endif -} - -void writeFloat(float num) -{ -#ifdef USE_GRAPHICS - char num_buf[10]; - ltoa(num, num_buf); - strcat(current_line, num_buf); - GrStringDraw(&g_sContext, current_line, strlen(current_line), 0, current_position - LINE_HEIGHT, true); -#endif -} - -void writeString(char* text) -{ -#ifdef USE_GRAPHICS - strcat(current_line,text); - GrStringDraw(&g_sContext, current_line, strlen(current_line), 0, current_position - LINE_HEIGHT, true); -#endif -} - -void clear() -{ -#ifdef USE_GRAPHICS - tRectangle backRect; - backRect.i16XMin = 0; - backRect.i16XMax = 340; - backRect.i16YMin = 240; - backRect.i16YMax = 0; - - GrContextForegroundSet(&g_sContext, ClrBlack); - GrRectFill(&g_sContext, &backRect); - - GrContextFontSet(&g_sContext, TEXT_FONT); - GrContextForegroundSet(&g_sContext, ClrWhite); - - current_position = 0; -#endif -} diff --git a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/graphics_adapter.h b/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/graphics_adapter.h deleted file mode 100644 index 3242f9068..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/twine_graphicslib/graphics_adapter.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * graphics_adapter.h - * - * Created on: Sep 24, 2017 - * Author: Roy - */ - -#include <stdbool.h> -#include <stdlib.h> -#include <stdint.h> -#include "grlib/grlib.h" -//#include "drivers/frame.h" -//#include "drivers/kentec320x240x16_ssd2119.h" - -//***************************************************************************** -// -// Graphics context used to show text on the color STN display. -// -//***************************************************************************** -static tContext g_sContext; -#define TEXT_FONT g_psFontCmss12 -#define TEXT_HEIGHT (GrFontHeightGet(TEXT_FONT)) -#define BUFFER_METER_HEIGHT TEXT_HEIGHT -#define BUFFER_METER_WIDTH 150 - -void init_graphics(uint32_t ui32SysClock); -void draw_image(uint8_t* data); -void draw_string(char* data, size_t length); -void writeLine(char* text); -void writeFloat(float num); -void writeString(char* text); -void clear(); diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg index c247f2f1b..47710100f 100644 --- a/Software/Embedded_SW/Embedded/Embedded.cfg +++ b/Software/Embedded_SW/Embedded/Embedded.cfg @@ -17,7 +17,7 @@ var Task = xdc.useModule('ti.sysbios.knl.Task'); BIOS.heapSize = 30767; // bios heapmem //Memory.defaultHeapSize = 48767; -Program.heap = 16767; //sysmem +Program.heap = 30767; //sysmem Clock.timerId = 7; diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index cb8755a68..18852e3fa 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -19,13 +19,13 @@ #include "Common/Sys_PinOut_Config/Pin_config.h" #include "Common/utilities/idle_task.h" #include "Drivers/ADC_Sampling/ADC.h" -#include "Drivers/Peripheral_GPIO/GPIO.h" + #include "drivers/Heater/Heater.h" #include "drivers/Motors/Motor.h" #include "Communication/CommunicationTask.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include <drivers/Flash_Memory/Flash_Memory.h> #include <DataDef.h> #include "Sys_PinOut_Config/MCU_MAIN_pinout.h" diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 1d0d3a205..c859bd778 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -38,6 +38,7 @@ #include "StateMachines/Printing/PrintingSTM.h" #include "drivers/FPGA/Moters_Driver/L6470.h" +#include "drivers/Motors/Motor.h" #include "drivers/Heater/TemperatureSensor.h" @@ -157,9 +158,36 @@ AlarmHandlingItem AlarmItem[MAX_SYSTEM_ALARMS]={ {100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_6,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser6OverTemperature,NULL}, {100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_7,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser7OverTemperature,NULL}, {100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_8,x_STATUS_TH_SD,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser8OverTemperature,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDryerUnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorFeederUnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_SCREW,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorScrewUnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_WINDER,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorWinderUnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorPoolerUnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser1UnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_2,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser2UnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_3,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser3UnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_4,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser4UnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_5,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser5UnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_6,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser6UnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_7,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser7UnderVoltage,NULL}, +//{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_8,x_STATUS_UVLO,true,DEBUG_LOG_CATEGORY__Error,0xFF,4,0,false,EVENT_TYPE__MotorDispenser8UnderVoltage,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDryerStall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorFeederStall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_SCREW,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorScrewStall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_WINDER,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorWinderStall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_LDRIVING,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorPoolerStall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDispenser1Stall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_2,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDispenser2Stall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_3,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDispenser3Stall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_4,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDispenser4Stall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_5,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDispenser5Stall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_6,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDispenser6Stall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_7,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDispenser7Stall,NULL}, +{100,MotorAlarm,HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_8,x_STATUS_STEP_LOSS_A,true,DEBUG_LOG_CATEGORY__Error,0xFF,8,0,false,EVENT_TYPE__MotorDispenser8Stall,NULL}, }; char TestMessage[5]="Test"; +bool EventsNotificationRequestAccepted = false; //read dispensers limit switches. 25 - send warning. up - stop job and send alarm //Cone missing //Dyeing head over temperature @@ -192,7 +220,7 @@ uint32_t AlarmHandlingConsequentActions(EventType EventId, DebugLogCategory Seve if (JobIsActive()) { JobEndReason = JOB_OTHER_ALARM; - EndState(NULL,event_type__descriptor.name[EventId]); + //EndState(NULL,event_type__descriptor.name[EventId]); } //Stop Job break; @@ -200,7 +228,7 @@ uint32_t AlarmHandlingConsequentActions(EventType EventId, DebugLogCategory Seve if (JobIsActive()) { JobEndReason = JOB_OTHER_ALARM; - EndState(NULL,event_type__descriptor.name[EventId]); + //EndState(NULL,event_type__descriptor.name[EventId]); } watchdogCriticalAlarm = true; //stop job @@ -255,9 +283,11 @@ uint32_t AlarmHandlingEmptyCBFunction(uint32_t IfIndex, uint32_t ReadValue) uint32_t AlarmHandlingStart(void) { + if (EventsNotificationRequestAccepted == false) + return ERROR; if ( AlarmHandlingActive == false) { - // AlarmHandlingActive = true; Disabled in running version + AlarmHandlingActive = true; AlarmHandlingControlId = AddControlCallback(AlarmHandling_ControlTrigger,eTenMillisecond,AlarmHandlingEmptyCBFunction,0,0,0); } return OK; @@ -499,8 +529,8 @@ uint32_t StartEventsNotificationRequestFunc(MessageContainer* requestContainer) // ReportInitParams InitParams; //ControlStart(); - //EventsNotificationRequestAccepted = true; - AlarmHandlingStart(); + EventsNotificationRequestAccepted = true; + //AlarmHandlingStart(); StartEventsNotificationRequest* request = start_events_notification_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); ustrncpy (AlarmHandlingToken, requestContainer->token,36); @@ -518,7 +548,7 @@ uint32_t StopEventsNotificationRequestFunc(MessageContainer* requestContainer) AlarmHandlingStop(); - //EventsNotificationRequestAccepted = false; + EventsNotificationRequestAccepted = false; responseContainer = createContainer(MESSAGE_TYPE__StopEventsNotificationResponse, requestContainer->token, false, &response, &stop_events_notification_response__pack, &stop_events_notification_response__get_packed_size); responseContainer.continuous = false; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 6aa8fd7a1..bb7bbaa92 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -51,7 +51,7 @@ #include <inc/hw_ints.h> #include "drivers/adc_sampling/adc.h" -#include "Drivers/Peripheral_GPIO/GPIO.h" + #include "control.h" #include "MillisecTask.h" /******************** Definitions ********************************************/ diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index 222b47b57..bb8da0b2e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -21,24 +21,11 @@ #include <PMR/Diagnostics/DispenserAbortHomingRequest.pb-c.h> #include <PMR/Diagnostics/DispenserAbortHomingResponse.pb-c.h> -#include <PMR/Diagnostics/DispenserJoggingRequest.pb-c.h> -#include <PMR/Diagnostics/DispenserJoggingResponse.pb-c.h> -#include <PMR/Diagnostics/DispenserAbortJoggingRequest.pb-c.h> -#include <PMR/Diagnostics/DispenserAbortJoggingResponse.pb-c.h> - #include <PMR/Diagnostics/MotorHomingRequest.pb-c.h> #include <PMR/Diagnostics/MotorHomingResponse.pb-c.h> #include <PMR/Diagnostics/MotorAbortHomingRequest.pb-c.h> #include <PMR/Diagnostics/MotorAbortHomingResponse.pb-c.h> -#include <PMR/Diagnostics/MotorJoggingRequest.pb-c.h> -#include <PMR/Diagnostics/MotorJoggingResponse.pb-c.h> -#include <PMR/Diagnostics/MotorAbortJoggingRequest.pb-c.h> -#include <PMR/Diagnostics/MotorAbortJoggingResponse.pb-c.h> - -#include <PMR/Diagnostics/SetComponentValueRequest.pb-c.h> -#include <PMR/Diagnostics/SetComponentValueResponse.pb-c.h> - #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #include "drivers/Motors/Motor.h" #include "drivers/Valves/Valve.h" @@ -287,220 +274,4 @@ uint32_t DispenserAbortHomingRequestFunc(MessageContainer* requestContainer) return OK; } -/******************************************************************************** - * Motor Jogging - ********************************************************************************/ - -uint32_t MotorJoggingRequestFunc(MessageContainer* requestContainer) -{ - uint32_t status = OK; - - MessageContainer responseContainer; - - MotorJoggingRequest* request = motor_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - - MotorJoggingResponse response = MOTOR_JOGGING_RESPONSE__INIT; - - TimerMotors_t MotorId = (TimerMotors_t)request->motortype; - bool direction; - int speed = request->speed; - if (speed == 0) speed = 150; - - if (MotorId <= NUM_OF_MOTORS) - { - if (JobIsActive() == false) - { - { - switch (request->direction) - { - case MOTOR_DIRECTION__Forward: - direction = MotorsCfg[MotorId].directionthreadwize; - break; - case MOTOR_DIRECTION__Backward: - direction = 1-MotorsCfg[MotorId].directionthreadwize; - break; - } - MotorSetDirection(MotorId,direction); - MotorSetSpeed(MotorId, speed); - } - } - else - { - status = ERROR; - } - } - else - { - status = ERROR; - } - - responseContainer = createContainer(MESSAGE_TYPE__MotorJoggingResponse, requestContainer->token, false, &response, &motor_jogging_response__pack, &motor_jogging_response__get_packed_size); - if (status!= OK) - { - responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; - responseContainer.errormessage = "JOb Active or incorrect parameters"; - } - responseContainer.continuous = false; - uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - free(responseContainer.data.data); - SendChars(container_buffer, container_size); - - return OK; -} - -uint32_t MotorAbortJoggingRequestFunc(MessageContainer* requestContainer) -{ - - MessageContainer responseContainer; - - MotorAbortJoggingRequest* request = motor_abort_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - - MotorAbortJoggingResponse response = MOTOR_ABORT_JOGGING_RESPONSE__INIT; - - TimerMotors_t MotorId = (TimerMotors_t)request->motortype; - - MotorStop(MotorId,Hard_Hiz); - - responseContainer = createContainer(MESSAGE_TYPE__MotorAbortJoggingResponse, requestContainer->token, false, &response, &motor_abort_jogging_response__pack, &motor_abort_jogging_response__get_packed_size); - responseContainer.continuous = false; - uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - free(responseContainer.data.data); - SendChars(container_buffer, container_size); - - return OK; -} - -/******************************************************************************** - * Dispenser Jogging - ********************************************************************************/ - -uint32_t DispenserJoggingRequestFunc(MessageContainer* requestContainer) -{ - uint32_t status = OK; - - MessageContainer responseContainer; - - DispenserJoggingRequest* request = dispenser_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - - DispenserJoggingResponse response = DISPENSER_JOGGING_RESPONSE__INIT; - - TimerMotors_t MotorId = (request->index)+HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1; - int speed = request->speed; - if (speed == 0) speed = 150; - - bool direction; - - if (MotorId <= NUM_OF_MOTORS) - { - if (JobIsActive() == false) - { - switch (request->direction) - { - case MOTOR_DIRECTION__Forward: - Control3WayValvesWithCallback ((Valves_t) request->index, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - direction = MotorsCfg[MotorId].directionthreadwize; - break; - case MOTOR_DIRECTION__Backward: - Control3WayValvesWithCallback ((Valves_t) request->index, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - direction = 1-MotorsCfg[MotorId].directionthreadwize; - break; - } - MotorSetDirection(MotorId,direction); - MotorSetSpeed(MotorId, speed); - } - else - { - status = ERROR; - } - } - else - { - status = ERROR; - } - - responseContainer = createContainer(MESSAGE_TYPE__DispenserJoggingResponse, requestContainer->token, false, &response, &dispenser_jogging_response__pack, &dispenser_jogging_response__get_packed_size); - if (status!= OK) - { - responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; - responseContainer.errormessage = "JOb Active or incorrect parameters"; - } - responseContainer.continuous = false; - uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - free(responseContainer.data.data); - SendChars(container_buffer, container_size); - - return OK; -} -uint32_t DispenserAbortJoggingRequestFunc(MessageContainer* requestContainer) -{ - - MessageContainer responseContainer; - - DispenserAbortJoggingRequest* request = dispenser_abort_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - - DispenserAbortJoggingResponse response = DISPENSER_ABORT_JOGGING_RESPONSE__INIT; - - TimerMotors_t MotorId = (request->index)+HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1; - MotorStop(MotorId,Hard_Hiz); - Control3WayValvesWithCallback ((Valves_t) request->index, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - - responseContainer = createContainer(MESSAGE_TYPE__DispenserAbortJoggingResponse, requestContainer->token, false, &response, &dispenser_abort_jogging_response__pack, &dispenser_abort_jogging_response__get_packed_size); - responseContainer.continuous = false; - uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - free(responseContainer.data.data); - SendChars(container_buffer, container_size); - - return OK; -} - -/******************************************************************************** - *Blower Diagnostic - ********************************************************************************/ -uint32_t SetComponentValueRequestRequestFunc(MessageContainer* requestContainer) -{ - MessageContainer responseContainer; - uint8_t* container_buffer; - uint32_t status = 0; - uint32_t intvoltage; - SetComponentValueRequest* request = set_component_value_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - - - - SetComponentValueResponse response = SET_COMPONENT_VALUE_RESPONSE__INIT; - - responseContainer = createContainer(MESSAGE_TYPE__SetComponentValueResponse, requestContainer->token, true, &response, &set_component_value_response__pack, &set_component_value_response__get_packed_size); - container_buffer = malloc(message_container__get_packed_size(&responseContainer)); - - - switch (request->component) - { - case VALUE_COMPONENT__BlowerVoltage: - blowervolatgedisplay = true; - voltage = request->value; - if (voltage == 0.0) - Turn_the_Blower_Off(); - else - { - Turn_the_Blower_On(); - intvoltage = voltage; - Control_Voltage_To_Blower(intvoltage); - } - break; - default: - break; - } - - size_t container_size = message_container__pack(&responseContainer, container_buffer); - free(responseContainer.data.data); - SendChars(container_buffer, container_size); - //free(container_buffer); - //free(requestContainer); - set_component_value_request__free_unpacked(request,NULL); - - return OK; -} diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c new file mode 100644 index 000000000..cf341b9a9 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c @@ -0,0 +1,262 @@ +/* + * DiagnosticsJogging.c + * + * Created on: 16 aug 2018 + * Author: shlomo + */ +/* + * DiagnosticsHoming.c + + * + * Created on: July 29 2018 + * Author: shlomo + */ +#include <DataDef.h> +#include "include.h" + +#include <inc/hw_ints.h> +#include <Container.h> + +#include "diagnostics.h" +#include "drivers/Motors/Motor.h" +#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" +#include "drivers/FPGA/FPGA.h" + +#include <PMR/Diagnostics/DispenserJoggingRequest.pb-c.h> +#include <PMR/Diagnostics/DispenserJoggingResponse.pb-c.h> +#include <PMR/Diagnostics/DispenserAbortJoggingRequest.pb-c.h> +#include <PMR/Diagnostics/DispenserAbortJoggingResponse.pb-c.h> + +#include <PMR/Diagnostics/MotorJoggingRequest.pb-c.h> +#include <PMR/Diagnostics/MotorJoggingResponse.pb-c.h> +#include <PMR/Diagnostics/MotorAbortJoggingRequest.pb-c.h> +#include <PMR/Diagnostics/MotorAbortJoggingResponse.pb-c.h> + +#include <PMR/Diagnostics/SetComponentValueRequest.pb-c.h> +#include <PMR/Diagnostics/SetComponentValueResponse.pb-c.h> + +#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" +#include "drivers/Motors/Motor.h" +#include "drivers/Valves/Valve.h" +#include "Drivers/I2C_Communication/DAC/blower.h" + +#include "StateMachines/Printing/PrintingSTM.h" + +/******************************************************************************** + * Motor Jogging + ********************************************************************************/ + +uint32_t MotorJoggingRequestFunc(MessageContainer* requestContainer) +{ + uint32_t status = OK; + + MessageContainer responseContainer; + + MotorJoggingRequest* request = motor_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + MotorJoggingResponse response = MOTOR_JOGGING_RESPONSE__INIT; + + TimerMotors_t MotorId = (TimerMotors_t)request->motortype; + bool direction; + int speed = request->speed; + if (speed == 0) speed = 150; + + if (MotorId <= NUM_OF_MOTORS) + { + if (JobIsActive() == false) + { + { + switch (request->direction) + { + case MOTOR_DIRECTION__Forward: + direction = MotorsCfg[MotorId].directionthreadwize; + break; + case MOTOR_DIRECTION__Backward: + direction = 1-MotorsCfg[MotorId].directionthreadwize; + break; + } + MotorSetDirection(MotorId,direction); + MotorSetSpeed(MotorId, speed); + } + } + else + { + status = ERROR; + } + } + else + { + status = ERROR; + } + + responseContainer = createContainer(MESSAGE_TYPE__MotorJoggingResponse, requestContainer->token, false, &response, &motor_jogging_response__pack, &motor_jogging_response__get_packed_size); + if (status!= OK) + { + responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; + responseContainer.errormessage = "JOb Active or incorrect parameters"; + } + responseContainer.continuous = false; + uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars(container_buffer, container_size); + + return OK; +} + +uint32_t MotorAbortJoggingRequestFunc(MessageContainer* requestContainer) +{ + + MessageContainer responseContainer; + + MotorAbortJoggingRequest* request = motor_abort_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + MotorAbortJoggingResponse response = MOTOR_ABORT_JOGGING_RESPONSE__INIT; + + TimerMotors_t MotorId = (TimerMotors_t)request->motortype; + + MotorStop(MotorId,Hard_Hiz); + + responseContainer = createContainer(MESSAGE_TYPE__MotorAbortJoggingResponse, requestContainer->token, false, &response, &motor_abort_jogging_response__pack, &motor_abort_jogging_response__get_packed_size); + responseContainer.continuous = false; + uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars(container_buffer, container_size); + + return OK; +} + +/******************************************************************************** + * Dispenser Jogging + ********************************************************************************/ + +uint32_t DispenserJoggingRequestFunc(MessageContainer* requestContainer) +{ + uint32_t status = OK; + + MessageContainer responseContainer; + + DispenserJoggingRequest* request = dispenser_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + DispenserJoggingResponse response = DISPENSER_JOGGING_RESPONSE__INIT; + + TimerMotors_t MotorId = (request->index)+HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1; + int speed = request->speed; + if (speed == 0) speed = 150; + + bool direction; + + if (MotorId <= NUM_OF_MOTORS) + { + if (JobIsActive() == false) + { + switch (request->direction) + { + case MOTOR_DIRECTION__Forward: + Control3WayValvesWithCallback ((Valves_t) request->index, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer + direction = MotorsCfg[MotorId].directionthreadwize; + break; + case MOTOR_DIRECTION__Backward: + Control3WayValvesWithCallback ((Valves_t) request->index, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer + direction = 1-MotorsCfg[MotorId].directionthreadwize; + break; + } + MotorSetDirection(MotorId,direction); + MotorSetSpeed(MotorId, speed); + } + else + { + status = ERROR; + } + } + else + { + status = ERROR; + } + + responseContainer = createContainer(MESSAGE_TYPE__DispenserJoggingResponse, requestContainer->token, false, &response, &dispenser_jogging_response__pack, &dispenser_jogging_response__get_packed_size); + if (status!= OK) + { + responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; + responseContainer.errormessage = "JOb Active or incorrect parameters"; + } + responseContainer.continuous = false; + uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars(container_buffer, container_size); + + return OK; +} +uint32_t DispenserAbortJoggingRequestFunc(MessageContainer* requestContainer) +{ + + MessageContainer responseContainer; + + DispenserAbortJoggingRequest* request = dispenser_abort_jogging_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + DispenserAbortJoggingResponse response = DISPENSER_ABORT_JOGGING_RESPONSE__INIT; + + TimerMotors_t MotorId = (request->index)+HARDWARE_MOTOR_TYPE__MOTO_DISPENSER_1; + MotorStop(MotorId,Hard_Hiz); + Control3WayValvesWithCallback ((Valves_t) request->index, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer + + responseContainer = createContainer(MESSAGE_TYPE__DispenserAbortJoggingResponse, requestContainer->token, false, &response, &dispenser_abort_jogging_response__pack, &dispenser_abort_jogging_response__get_packed_size); + responseContainer.continuous = false; + uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars(container_buffer, container_size); + + return OK; +} + +/******************************************************************************** + *Blower Diagnostic + ********************************************************************************/ +uint32_t SetComponentValueRequestRequestFunc(MessageContainer* requestContainer) +{ + MessageContainer responseContainer; + uint8_t* container_buffer; + uint32_t status = 0; + uint32_t intvoltage; + SetComponentValueRequest* request = set_component_value_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + + + SetComponentValueResponse response = SET_COMPONENT_VALUE_RESPONSE__INIT; + + responseContainer = createContainer(MESSAGE_TYPE__SetComponentValueResponse, requestContainer->token, true, &response, &set_component_value_response__pack, &set_component_value_response__get_packed_size); + container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + + + switch (request->component) + { + case VALUE_COMPONENT__BlowerVoltage: + blowervolatgedisplay = true; + voltage = request->value; + if (voltage == 0.0) + Turn_the_Blower_Off(); + else + { + Turn_the_Blower_On(); + intvoltage = voltage; + Control_Voltage_To_Blower(intvoltage); + } + break; + default: + break; + } + + size_t container_size = message_container__pack(&responseContainer, container_buffer); + free(responseContainer.data.data); + SendChars(container_buffer, container_size); + //free(container_buffer); + //free(requestContainer); + set_component_value_request__free_unpacked(request,NULL); + + return OK; +} + + diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index e8fe8783d..dc9d89766 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -107,7 +107,7 @@ uint32_t HWConfigurationFunc(MessageContainer* requestContainer) } ControlStart(); - //AlarmHandlingStart(); + AlarmHandlingStart(); //ThreadInitialTestStub(request); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c index 6cb67542f..e386df88c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Calculate.c @@ -7,7 +7,7 @@ #include "driverlib/gpio.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + void Stub_CalculateRequest(MessageContainer* requestContainer) { @@ -15,10 +15,6 @@ void Stub_CalculateRequest(MessageContainer* requestContainer) CalculateRequest* request = calculate_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("Calculate Request: "); - writeFloat(request->a); - writeString(" + "); - writeFloat(request->b); CalculateResponse response = CALCULATE_RESPONSE__INIT; response.sum = request->a + request->b; @@ -26,9 +22,6 @@ void Stub_CalculateRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__CalculateResponse, requestContainer->token, true, &response, &calculate_response__pack, &calculate_response__get_packed_size); - writeLine("Sending Response: "); - writeFloat(response.sum); - // free(request); uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index e38abdab3..919e84582 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -29,8 +29,6 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); free(responseContainer.data.data); - //writeLine("Sending Progress: "); - //writeFloat(response.progress); SendChars((char*)container_buffer, container_size); //free(container_buffer); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c index fbfb0ed85..997d67973 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c @@ -25,7 +25,7 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "MessageContainer.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c index 49c7d0d3b..581a27f1f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Cartridge.c @@ -12,7 +12,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "Stub_Status.h" @@ -25,10 +25,6 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) //request->cartridgeid - writeLine("cartridge Request: "); - - writeFloat(request->cartridgeid); - StubCartridgeReadResponse response = STUB_CARTRIDGE_READ_RESPONSE__INIT; response.cartridgeid = request->cartridgeid; @@ -48,18 +44,6 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeFloat(response.cartridgeid); - writeString(", "); - writeFloat(response.cartridgecolor); - writeString(", "); - writeFloat(response.cartridgeversion); - writeString(", "); - writeFloat(response.cartridgedata); - writeString(", "); - writeFloat(response.cartridgeused); - writeString(", "); Write_status_response(status); @@ -88,17 +72,6 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) //request->cartridgedata //request->cartridgeused - writeLine("Cartridge Request: "); - - writeFloat(request->cartridgeid); - writeString(", "); - writeFloat(request->cartridgecolor); - writeString(", "); - writeFloat(request->cartridgeversion); - writeString(", "); - writeFloat(request->cartridgedata); - writeString(", "); - writeFloat(request->cartridgeused); StubCartridgeWriteResponse response = STUB_CARTRIDGE_WRITE_RESPONSE__INIT; @@ -111,12 +84,6 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer) // response.has_statusword = true; status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeFloat(response.cartridgeid); - writeString(", "); -// writeFloat(response.statusword); -// WRITELINESTATUS; Write_status_response(status); responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeWriteResponse, requestContainer->token, true, &response, &stub_cartridge_write_response__pack, &stub_cartridge_write_response__get_packed_size); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c index 499f227a9..b7f6a387f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c @@ -22,7 +22,7 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "MessageContainer.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c index 2d121faa7..0bcc9f7c9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dispenser.c @@ -10,7 +10,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" #include "drivers/adc_sampling/adc.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "Stub_Status.h" #include <math.h> @@ -40,17 +40,6 @@ void Stub_DispenserRequest(MessageContainer* requestContainer) //request->setmicrostepdivision //request->setspeed - writeLine("Dispenser Request: "); - - writeFloat(request->dispenserid); - writeString(", "); - writeFloat(request->start); - writeString(", "); - writeFloat(request->setdirection); - writeString(", "); - writeFloat(request->setmicrostepdivision); - writeString(", "); - writeFloat(request->setspeed); StubDispenserResponse response = STUB_DISPENSER_RESPONSE__INIT; @@ -68,14 +57,6 @@ void Stub_DispenserRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeFloat(response.dispenserid); - writeString(", "); - writeFloat(response.dispenserposition); - writeString(", "); - writeFloat(response.inkworninglevel); - writeString(", "); Write_status_response(status); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c index d75ce8663..f478e9428 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ExtFlash.c @@ -23,7 +23,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "Stub_Status.h" @@ -48,16 +48,6 @@ void Stub_ExtFlashWriteRequest(MessageContainer* requestContainer) WriteBuf[3] = request->wordtowrite4; WriteBuf[4] = request->wordtowrite5; - writeLine("ExtFlash Request: "); - writeFloat(request->wordtowrite1); - writeString(", "); - writeFloat(request->wordtowrite2); - writeString(", "); - writeFloat(request->wordtowrite3); - writeString(", "); - writeFloat(request->wordtowrite4); - writeString(", "); - writeFloat(request->wordtowrite5); Ext_Flash_Operation(0X00,TX, Max_words, WriteBuf, NULL ); @@ -67,7 +57,6 @@ void Stub_ExtFlashWriteRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubExtFlashWriteResponse, requestContainer->token, true, &response, &stub_ext_flash_write_response__pack, &stub_ext_flash_write_response__get_packed_size); - writeLine("Sending Response: "); Write_status_response(status); @@ -105,9 +94,6 @@ void Stub_ExtFlashReadRequest(MessageContainer* requestContainer) Ext_Flash_Operation(0X00,RX, No_Words, NULL, ReadBuf ); - writeLine("ExtFlash Request: "); - writeFloat(request->number_of_words); - StubExtFlashReadResponse response = STUB_EXT_FLASH_READ_RESPONSE__INIT; @@ -143,20 +129,6 @@ void Stub_ExtFlashReadRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubExtFlashReadResponse, requestContainer->token, true, &response, &stub_ext_flash_read_response__pack, &stub_ext_flash_read_response__get_packed_size); //clear(); - writeLine("Sending Response: "); - - Write_status_response(status); - writeString(", "); - writeFloat(response.readword_1); - writeString(", "); - writeFloat(response.readword_2); - writeString(", "); - writeFloat(response.readword_3); - writeString(", "); - writeFloat(response.readword_4); - writeString(", "); - writeFloat(response.readword_5); - //free(request); //------------------------------------------------------------------------------------------- uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); @@ -337,9 +309,6 @@ void Stub_ExtFlashWriteWordsRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubExtFlashWriteWordsResponse, requestContainer->token, true, &response, &stub_ext_flash_write_words_response__pack, &stub_ext_flash_write_words_response__get_packed_size); - writeLine("Sending Response: "); - - Write_status_response(status); //------------------------------------------------------------------------------------------- uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGARWReg.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGARWReg.c index bd8f38db5..2fd85db09 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGARWReg.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGARWReg.c @@ -16,7 +16,7 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "MessageContainer.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGAReadBackReg.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGAReadBackReg.c index eef70ee37..7fad9ffce 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGAReadBackReg.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGAReadBackReg.c @@ -13,7 +13,7 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "MessageContainer.pb-c.h" @@ -30,11 +30,6 @@ void Stub_FPGAReadBackRegRequest(MessageContainer* requestContainer) StubFPGAReadBackRegRequest* request = stub_fpgaread_back_reg_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("ReadBack Request: "); - - writeFloat(request->fpgaid); - writeString(", "); - writeFloat(request->value); status = FPGA_Test_ReadBack((unsigned char) request->fpgaid, (unsigned short) request->value, &ReadBack_Value); @@ -49,14 +44,6 @@ void Stub_FPGAReadBackRegRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubFPGAReadBackRegResponse, requestContainer->token, true, &response, &stub_fpgaread_back_reg_response__pack, &stub_fpgaread_back_reg_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.fpgaid); - writeString(", "); - writeFloat(response.readbackvalue); - writeString(", "); - - Write_status_response(status); //free(request); stub_fpgaread_back_reg_request__free_unpacked(request,NULL); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGAReadVersion.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGAReadVersion.c index bf287325b..935b3d476 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGAReadVersion.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_FPGAReadVersion.c @@ -13,7 +13,7 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "MessageContainer.pb-c.h" @@ -32,9 +32,6 @@ void Stub_FPGAReadVersionRequest(MessageContainer* requestContainer) StubFPGAReadVersionRequest* request = stub_fpgaread_version_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("ReadBack Request: "); - - writeFloat(request->fpgaid); status = FPGA_ReadVersion((unsigned char)request->fpgaid, &Version, &Year, &Month, &Day); @@ -55,21 +52,6 @@ void Stub_FPGAReadVersionRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubFPGAReadVersionResponse, requestContainer->token, true, &response, &stub_fpgaread_version_response__pack, &stub_fpgaread_version_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.fpgaid); - writeString(", "); - writeFloat(response.day); - writeString(", "); - writeFloat(response.month); - writeString(", "); - writeFloat(response.year); - writeString(", "); - writeFloat(response.ver_num); - writeString(", "); - - Write_status_response(status); - //free(request); stub_fpgaread_version_request__free_unpacked(request,NULL); //------------------------------------------------------------------------------------------- diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_GPIO.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_GPIO.c index ed3fd6512..a05c04f6e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_GPIO.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_GPIO.c @@ -25,8 +25,6 @@ #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" - #include <Modules/Stubs_Handler/User_Leds.h> #include "Stub_Status.h" @@ -38,14 +36,6 @@ void Stub_GPIOWriteBitRequest(MessageContainer* requestContainer) StubGPIOWriteBitRequest* request = stub_gpiowrite_bit_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("GPIO Request: "); - - writeString(request->portid); - writeString(", "); - writeFloat(request->pinid); - writeString(", "); - writeFloat(request->bittowrite); - uint8_t PinId = 0; uint32_t PortId = 0; @@ -169,8 +159,7 @@ void Stub_GPIOWriteBitRequest(MessageContainer* requestContainer) break; default: - writeLine("Unsupported Port ID: "); - writeString(request->portid); + LOG_ERROR (request->portid," Unsupported Port ID "); break; } @@ -205,16 +194,6 @@ void Stub_GPIOWriteBitRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeString(response.portid); - writeString(", "); - writeFloat(response.pinid); - writeString(", "); - - Write_status_response(status); - - responseContainer = createContainer(MESSAGE_TYPE__StubGPIOWriteBitResponse, requestContainer->token, true, &response, &stub_gpiowrite_bit_response__pack, &stub_gpiowrite_bit_response__get_packed_size); //------------------------------------------------------------------------------------------- @@ -237,10 +216,6 @@ void Stub_GPIOReadByteRequest(MessageContainer* requestContainer) StubGPIOReadByteRequest* request = stub_gpioread_byte_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("GPIO Request: "); - - writeString(request->portid); - char Port = request->portid[0]; uint32_t PortId = 0; @@ -332,8 +307,7 @@ void Stub_GPIOReadByteRequest(MessageContainer* requestContainer) break; default: - writeLine("Unsupported Port ID: "); - writeString(request->portid); + LOG_ERROR (request->portid," Unsupported Port ID "); break; } @@ -347,15 +321,6 @@ void Stub_GPIOReadByteRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeString(response.portid); - writeString(", "); - writeFloat(response.bytevalue); - writeString(", "); - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubGPIOReadByteResponse, requestContainer->token, true, &response, &stub_gpioread_byte_response__pack, &stub_gpioread_byte_response__get_packed_size); //------------------------------------------------------------------------------------------- @@ -376,12 +341,6 @@ void Stub_GPIOReadBitRequest(MessageContainer* requestContainer) StubGPIOReadBitRequest* request = stub_gpioread_bit_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("GPIO Request: "); - - writeString(request->portid); - writeString(", "); - writeFloat(request->pinid); - uint8_t PinId = 0; uint32_t PortId = 0; @@ -504,8 +463,7 @@ void Stub_GPIOReadBitRequest(MessageContainer* requestContainer) break; default: - writeLine("Unsupported Port ID: "); - writeString(request->portid); + LOG_ERROR (request->portid," Unsupported Port ID "); break; } @@ -545,17 +503,6 @@ void Stub_GPIOReadBitRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeString(response.portid); - writeString(", "); - writeFloat(response.pinid); - writeString(", "); - writeFloat(response.bitvalue); - writeString(", "); - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubGPIOReadBitResponse, requestContainer->token, true, &response, &stub_gpioread_bit_response__pack, &stub_gpioread_bit_response__get_packed_size); ///////////////////////////////////////////----------------------------------------------------------------------------- @@ -592,17 +539,6 @@ void Stub_GPIOReadBitRequest(MessageContainer* requestContainer) response.status = OK; response.has_status = true; - writeLine("Sending Response: "); - - writeString(response.portid); - writeString(", "); - writeFloat(response.pinid); - writeString(", "); - writeFloat(response.bitvalue); - writeString(", "); - writeFloat(response.status); - WRITELINESTATUS; - responseContainer = createContainer(MESSAGE_TYPE__StubGPIOReadBitResponse, requestContainer->token, true, &response, &stub_gpioread_bit_response__pack, &stub_gpioread_bit_response__get_packed_size); */ //------------------------------------------------------------------------------------------- @@ -624,12 +560,6 @@ void Stub_GPIOWriteByteRequest(MessageContainer* requestContainer) StubGPIOWriteByteRequest* request = stub_gpiowrite_byte_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("GPIO Request: "); - - writeString(request->portid); - writeString(", "); - writeFloat(request->datatowrite); - uint32_t PortId = 0; char Port = request->portid[0]; @@ -721,8 +651,7 @@ void Stub_GPIOWriteByteRequest(MessageContainer* requestContainer) break; default: - writeLine("Unsupported Port ID: "); - writeString(request->portid); + LOG_ERROR (request->portid," Unsupported Port ID "); break; } @@ -742,13 +671,6 @@ void Stub_GPIOWriteByteRequest(MessageContainer* requestContainer) } status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeString(response.portid); - writeString(", "); - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubGPIOWriteByteResponse, requestContainer->token, true, &response, &stub_gpiowrite_byte_response__pack, &stub_gpiowrite_byte_response__get_packed_size); //------------------------------------------------------------------------------------------- @@ -770,16 +692,6 @@ void Stub_GPIOInputSetupRequest(MessageContainer* requestContainer) StubGPIOInputSetupRequest* request = stub_gpioinput_setup_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("GPIO Request: "); - - writeString(request->portid); - writeString(", "); - writeFloat(request->pinid); - writeString(", "); - writeFloat(request->setinput); - writeString(", "); - writeFloat(request->setpullup); - uint8_t PinId = 0; uint32_t PortId = 0; @@ -903,8 +815,7 @@ void Stub_GPIOInputSetupRequest(MessageContainer* requestContainer) break; default: - writeLine("Unsupported Port ID: "); - writeString(request->portid); + LOG_ERROR (request->portid," Unsupported Port ID "); break; } @@ -937,15 +848,6 @@ void Stub_GPIOInputSetupRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeString(response.portid); - writeString(", "); - writeFloat(response.pinid); - writeString(", "); - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubGPIOInputSetupResponse, requestContainer->token, true, &response, &stub_gpioinput_setup_response__pack, &stub_gpioinput_setup_response__get_packed_size); //------------------------------------------------------------------------------------------- diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_HW_Version.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_HW_Version.c index fee7782fc..09244364a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_HW_Version.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_HW_Version.c @@ -13,7 +13,6 @@ #include "inc/hw_uart.h" #include "driverlib/gpio.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" #include "MessageContainer.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Heater.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Heater.c index 317a8c540..47e1bda34 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Heater.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Heater.c @@ -16,7 +16,7 @@ #include "driverlib/gpio.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "Stub_Status.h" #include "Drivers/Heater/Heater.h" @@ -35,12 +35,6 @@ void Stub_HeaterRequest(MessageContainer* requestContainer) request->heatergroupon */ - writeLine("Heater Request: "); - - writeFloat(request->heatergroupid); - writeString(", "); - writeFloat(request->heatergroupon); - if (request->heatergroupon ) status = ActivateHeater(request->heatergroupid); else @@ -55,15 +49,6 @@ void Stub_HeaterRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeFloat(response.heatergroupid); - writeString(", "); - writeFloat(response.heatertemperaturesensor); - writeString(", "); - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubHeaterResponse, requestContainer->token, true, &response, &stub_heater_response__pack, &stub_heater_response__get_packed_size); //------------------------------------------------------------------------------------------- diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_I2C.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_I2C.c index 9539be0f9..e749b41ec 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_I2C.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_I2C.c @@ -23,7 +23,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "Stub_Status.h" #include "drivers/I2C_Communication/I2C.h" @@ -63,11 +63,6 @@ void Stub_I2CRequest(MessageContainer* requestContainer) */ status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); -// - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubI2CResponse, requestContainer->token, true, &response, &stub_i2_cresponse__pack, &stub_i2_cresponse__get_packed_size); //------------------------------------------------------------------------------------------- @@ -126,11 +121,6 @@ void Stub_I2CWriteBytesRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); -// - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubI2CWriteBytesResponse, requestContainer->token, true, &response, &stub_i2_cwrite_bytes_response__pack, &stub_i2_cwrite_bytes_response__get_packed_size); //------------------------------------------------------------------------------------------- @@ -184,11 +174,6 @@ void Stub_I2CReadBytesRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); -// - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubI2CReadBytesResponse, requestContainer->token, true, &response, &stub_i2_cread_bytes_response__pack, &stub_i2_cread_bytes_response__get_packed_size); //------------------------------------------------------------------------------------------- diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_IntADC.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_IntADC.c index 85d7468bc..d9d35f363 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_IntADC.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_IntADC.c @@ -20,8 +20,6 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" - #include "MessageContainer.pb-c.h" #include "Stub_Status.h" @@ -38,10 +36,6 @@ void Stub_IntADCReadRequest(MessageContainer* requestContainer) StubIntADCReadRequest* request = stub_int_adcread_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("ReadBack Request: "); - - writeFloat(request->adc_device); - ADCAcquireInit(); SysCtlDelay(10000); ADCAcquireStart(0,1); @@ -76,17 +70,6 @@ void Stub_IntADCReadRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubIntADCReadResponse, requestContainer->token, true, &response, &stub_int_adcread_response__pack, &stub_int_adcread_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.adc_device); - writeString(", "); - writeFloat(response.sampling_in_bits); - writeString(", "); - writeFloat(response.voltage_sampling_mv); - writeString(", "); - - Write_status_response(status); - stub_int_adcread_request__free_unpacked(request,NULL); //------------------------------------------------------------------------------------------- uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_L6470.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_L6470.c index 9381515f1..b85b45a21 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_L6470.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_L6470.c @@ -12,8 +12,6 @@ #include "inc/hw_types.h" #include "inc/hw_uart.h" -#include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" #include "MessageContainer.pb-c.h" @@ -76,10 +74,6 @@ void Stub_L6470DriverRequest(MessageContainer* requestContainer) TestUint32_5 = request->testuint32_5; TestUint32_6 = request->testuint32_6; - writeLine("L6470 Request: "); - - writeFloat(request->run_value); - //status = FPGA_ReadVersion((unsigned char)request->fpgaid, &Version, &Year, &Month, &Day); SPI_Control(INIT); @@ -104,22 +98,6 @@ void Stub_L6470DriverRequest(MessageContainer* requestContainer) */ responseContainer = createContainer(MESSAGE_TYPE__StubL6470DriverResponse, requestContainer->token, true, &response, &stub_l6470_driver_response__pack, &stub_l6470_driver_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.run_value); - /* - writeString(", "); - writeFloat(response.day); - writeString(", "); - writeFloat(response.month); - writeString(", "); - writeFloat(response.year); - writeString(", "); - writeFloat(response.ver_num); - writeString(", "); -*/ - Write_status_response(status); - //free(request); //------------------------------------------------------------------------------------------- uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c index 47048196b..c0f0954ed 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Motor.c @@ -30,7 +30,6 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" #include "MessageContainer.pb-c.h" @@ -87,19 +86,14 @@ void Stub_MotorInitRequest(MessageContainer* requestContainer) MotorDriverConfig.maxchangeslope = request->acc; MotorDriverConfig.maxchangeslope = request->dec; MotorDriverConfig.maxfrequency = request->max_speed; - MotorDriverConfig.has_setmicrostep = request->has_micro_steps; - if ( MotorDriverConfig.has_setmicrostep) - MotorDriverConfig.microstep = request->micro_steps; + MotorDriverConfig.microstep = request->micro_steps; // else // MotorDriverConfig.Microstep = 2; //MotorDriverConfig.HasConfigWord = false; - MotorDriverConfig.has_configword = request->has_config; MotorDriverConfig.configword = request->config; - MotorDriverConfig.has_lowspeedoptimization = request->has_min_speed_lspd_opt; - MotorDriverConfig.lowspeedoptimization = request->has_min_speed_lspd_opt; MotorDriverConfig.kvalhold = request->kval_hold; MotorDriverConfig.kvalrun = request->kval_run; MotorDriverConfig.kvalacc = request->kval_acc; @@ -167,15 +161,6 @@ void Stub_MotorInitRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubMotorInitResponse, requestContainer->token, true, &response, &stub_motor_init_response__pack, &stub_motor_init_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.motor_id); - writeString(", "); - writeFloat(response.status); - - //writeString(", "); - // - //Write_status_response(status); //free(request); //------------------------------------------------------------------------------------------- @@ -257,15 +242,6 @@ void Stub_MotorRunRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubMotorRunResponse, requestContainer->token, true, &response, &stub_motor_run_response__pack, &stub_motor_run_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.motor_id); - - //writeString(", "); - //writeFloat(response.day); - - //Write_status_response(status); - //free(request); //------------------------------------------------------------------------------------------- uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); @@ -299,14 +275,6 @@ void Stub_MotorStopRequest(MessageContainer* requestContainer) MotorStop(Motor_Id, Stop_Command); #endif - - - - - //writeLine("L6470 Request: "); - - //writeFloat(request->run_value); - //status = FPGA_ReadVersion((unsigned char)request->fpgaid, &Version, &Year, &Month, &Day); @@ -332,14 +300,6 @@ void Stub_MotorStopRequest(MessageContainer* requestContainer) #endif responseContainer = createContainer(MESSAGE_TYPE__StubMotorStopResponse, requestContainer->token, true, &response, &stub_motor_stop_response__pack, &stub_motor_stop_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.motor_id); - - //writeString(", "); - //writeFloat(response.day); - - //Write_status_response(status); //free(request); //------------------------------------------------------------------------------------------- @@ -454,10 +414,6 @@ void Stub_MotorStatusRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubMotorStatusResponse, requestContainer->token, true, &response, &stub_motor_status_response__pack, &stub_motor_status_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.motor_id); - //free(request); //------------------------------------------------------------------------------------------- @@ -687,11 +643,6 @@ void Stub_MotorRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubMotorResponse, requestContainer->token, true, &response, &stub_motor_response__pack, &stub_motor_response__get_packed_size); - writeLine("Sending Response: "); - - writeFloat(response.motor_id); - - //free(request); //------------------------------------------------------------------------------------------- uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_OptLimitSwitch.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_OptLimitSwitch.c index 6e763a825..ad463c38f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_OptLimitSwitch.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_OptLimitSwitch.c @@ -17,7 +17,6 @@ #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" #include "Stub_Status.h" @@ -34,12 +33,6 @@ void Stub_OptLimitSwitchRequest(MessageContainer* requestContainer) request->limitswitchrdisable */ - writeLine("OptLimit Switch Request: "); - - writeFloat(request->limitswitchrid); - writeString(", "); - writeFloat(request->limitswitchrdisable); - StubOptLimitSwitchResponse response = STUB_OPT_LIMIT_SWITCH_RESPONSE__INIT; response.limitswitchrid = request->limitswitchrid; @@ -50,15 +43,6 @@ void Stub_OptLimitSwitchRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeFloat(response.limitswitchrid); - writeString(", "); - writeFloat(response.limitswitchditection); - writeString(", "); - - Write_status_response(status); - responseContainer = createContainer(MESSAGE_TYPE__StubOptLimitSwitchResponse, requestContainer->token, true, &response, &stub_opt_limit_switch_response__pack, &stub_opt_limit_switch_response__get_packed_size); //------------------------------------------------------------------------------------------- diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ReadEmbeddedVersion.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ReadEmbeddedVersion.c index c10afb070..b21e6a9ce 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ReadEmbeddedVersion.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_ReadEmbeddedVersion.c @@ -21,7 +21,7 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "MessageContainer.pb-c.h" @@ -40,8 +40,6 @@ void Stub_ReadEmbeddedVersionRequest(MessageContainer* requestContainer) StubReadEmbeddedVersionRequest* request = stub_read_embedded_version_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("ReadBack Request: "); - StubReadEmbeddedVersionResponse response = STUB_READ_EMBEDDED_VERSION_RESPONSE__INIT; GetTangoVersion(&buffer); @@ -58,9 +56,6 @@ void Stub_ReadEmbeddedVersionRequest(MessageContainer* requestContainer) response.verpatch = buffer[2]; response.verbuild = buffer[3]; - writeLine("Sending Response: "); - - responseContainer = createContainer(MESSAGE_TYPE__StubReadEmbeddedVersionResponse, requestContainer->token, true, &response, &stub_read_embedded_version_response__pack, &stub_read_embedded_version_response__get_packed_size); //free(request); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SpeedSensor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SpeedSensor.c index a71ce8d98..a433be2ce 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SpeedSensor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SpeedSensor.c @@ -22,9 +22,6 @@ #include "inc/hw_types.h" #include "inc/hw_uart.h" -#include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" - #include "MessageContainer.pb-c.h" #include "Stub_Status.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Status.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Status.c index 00299c74c..b657b6274 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Status.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Status.c @@ -1,11 +1,6 @@ #include "include.h" -/*#include <graphics_adapter.h> -#include <stdbool.h> -#include <stdint.h> -#include "Stub_Status.h" -#include <Stubs_Handler/DataDef.h>*/ -#include "drivers/twine_graphicslib/graphics_adapter.h" + int status_response(uint32_t Rstatus,char *status[20],uint32_t *statusword ,protobuf_c_boolean *has_statusword) { @@ -36,23 +31,5 @@ int status_response(uint32_t Rstatus,char *status[20],uint32_t *statusword ,prot int Write_status_response(uint32_t Rstatus) { - writeFloat(Rstatus); - - if(Rstatus==PASSED) - { - writeLine("PASSED"); - } - else if(Rstatus==VERIFIED) - { - writeLine("PASSED (VERIFIED)"); - } - else if(Rstatus==NOT_SUPPORTED) - { - writeLine("NOT_SUPPORTED"); - } - else - { - writeLine("FAILED"); - } return 0; } diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SteperMotor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SteperMotor.c index d628e5d4a..dcb61dcde 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SteperMotor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_SteperMotor.c @@ -17,7 +17,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "Stub_Status.h" @@ -29,17 +29,6 @@ void Stub_SteperMotorRequest(MessageContainer* requestContainer) StubSteperMotorRequest* request = stub_steper_motor_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - writeLine("Steper Motor Request: "); - - writeFloat(request->motorid); - writeString(", "); - writeFloat(request->start); - writeString(", "); - writeFloat(request->setdirection); - writeString(", "); - writeFloat(request->setmicrostepdivision); - writeString(", "); - writeFloat(request->setspeed); /* request->motorid request->start @@ -58,16 +47,6 @@ void Stub_SteperMotorRequest(MessageContainer* requestContainer) status_response(status,&response.status, &response.statusword ,&response.has_statusword); - writeLine("Sending Response: "); - - writeFloat(response.motorid); - writeString(", "); - writeFloat(response.motorversion); - writeString(", "); - - Write_status_response(status); - - responseContainer = createContainer(MESSAGE_TYPE__StubSteperMotorResponse, requestContainer->token, true, &response, &stub_steper_motor_response__pack, &stub_steper_motor_response__get_packed_size); //------------------------------------------------------------------------------------------- diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_TempSensor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_TempSensor.c index cf8f79a02..8c17787fc 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_TempSensor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_TempSensor.c @@ -21,7 +21,7 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" + #include "MessageContainer.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_TivaReg.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_TivaReg.c index ee4aca19d..35aca3c7d 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_TivaReg.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_TivaReg.c @@ -22,7 +22,6 @@ #include "inc/hw_uart.h" #include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" #include "MessageContainer.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Valve.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Valve.c index af46e4193..759d76a43 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Valve.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Valve.c @@ -17,7 +17,6 @@ #include "Drivers/USB_Communication/USBCDCD.h" #include "drivers/Valves/Valve.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" #include "Stub_Status.h" @@ -33,13 +32,6 @@ void Stub_ValveRequest(MessageContainer* requestContainer) request->inkflow request->valveon */ - writeLine("Valve Request: "); - writeFloat(request->valveid); - writeString(", "); - writeFloat(request->inkflow); - writeString(", "); - writeFloat(request->valveon); - Control3WayValvesWithCallback (request->valveid, request->valveon, NULL); //test_valve_3_way(request->valveid, request->valveon); @@ -49,10 +41,6 @@ void Stub_ValveRequest(MessageContainer* requestContainer) responseContainer = createContainer(MESSAGE_TYPE__StubValveResponse, requestContainer->token, true, &response, &stub_valve_response__pack, &stub_valve_response__get_packed_size); - writeLine("Sending Response: "); - - Write_status_response(status); - //free(request); //------------------------------------------------------------------------------------------- uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer)); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/temperature_sensor.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/temperature_sensor.c index 994f6d84f..33db0d045 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/temperature_sensor.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/temperature_sensor.c @@ -76,8 +76,6 @@ #include "utils/uartstdio.c" #include <string.h> -#include "Drivers/USB_Communication/USBCDCD.h" -#include "drivers/twine_graphicslib/graphics_adapter.h" //***************************************************************************** // @@ -146,18 +144,12 @@ int temperature_main(){ // // Display the setup on the console. // - UARTprintf("ADC ->\n"); + /*UARTprintf("ADC ->\n"); UARTprintf(" Type: Internal Temperature Sensor\n"); UARTprintf(" Samples: One\n"); UARTprintf(" Update Rate: 250ms\n"); UARTprintf(" Input Pin: Internal temperature sensor\n\n"); - - writeLine("ADC ->\n"); - writeLine(" Type: Internal Temperature Sensor\n"); - writeLine(" Samples: One\n"); - writeLine(" Update Rate: 250ms\n"); - writeLine(" Input Pin: Internal temperature sensor\n\n"); - +*/ // // The ADC0 peripheral must be enabled for use. // @@ -246,9 +238,6 @@ int temperature_main(){ UARTprintf("Temperature = %3d*C or %3d*F\r", TempValueC, TempValueF); - writeLine("Temperature(Celsius): "); - writeFloat(TempValueC); - // // This function provides a means of generating a constant length // delay. The function delay (in cycles) = 3 * parameter. Delay diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h index 2aa0b220a..a725468e9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread.h @@ -13,7 +13,6 @@ #include "PMR/Printing/JobSpoolType.pb-c.h" #include "drivers/Motors/Motor.h" -#include "drivers/SSI_Comm/ssi_comm.h" #include "thread_ex.h" @@ -39,7 +38,7 @@ extern HardwarePidControlType ThreadMotorIdToControlId[MAX_THREAD_MOTORS_NUM]; extern bool BreakSensorenabled; extern int32_t BreakSensordebouncetimemilli; -extern HardwareMotor MotorsCfg[NUM_OF_MOTORS]; +//extern MotorDriverConfigStruc MotorsCfg[NUM_OF_MOTORS]; extern HardwarePidControl MotorsControl[MAX_THREAD_MOTORS_NUM]; //extern InternalWinderConfigStruc InternalWinderCfg; extern HardwareDancer DancersCfg[MAX_SYSTEM_DANCERS]; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index f4242be2b..92fd9549e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -6,7 +6,7 @@ */ #include"include.h" #include "thread.h" -#include "Drivers/Peripheral_GPIO/GPIO.h" + #include "drivers/Motors/Motor.h" #include "StateMachines/Printing/PrintingSTM.h" #include "Modules/Control/Control.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index e4a5b362c..41daa4002 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -12,7 +12,7 @@ #include "PMR/common/MessageContainer.pb-c.h" #include "thread.h" -HardwareMotor MotorsCfg[NUM_OF_MOTORS]={0}; +MotorDriverConfigStruc MotorsCfg[NUM_OF_MOTORS]={0}; HardwarePidControl MotorsControl[MAX_THREAD_MOTORS_NUM] = {0}; int32_t MotorSamples[MAX_THREAD_MOTORS_NUM][MAX_CONTROL_SAMPLES] = {0}; @@ -32,22 +32,32 @@ uint32_t MotorsConfigMessage(HardwareMotor * request) uint32_t status = PASSED; TimerMotors_t Motor_i; Motor_i = request->hardwaremotortype; - /*for (i=0;i<MAX_THREAD_MOTORS_NUM;i++) - { - if (ThreadMotorIdToControlId[i] == request->hardwarepidcontroltype) - { - Motor_i = i; - break; - } - } - if (Motor_i == 0) - { - LOG_ERROR(request->hardwarepidcontroltype,"ERROR Control Id"); - return ERROR; - }*/ - //if (Motor_i< MAX_THREAD_MOTORS_NUM) - //{ - memcpy (&MotorsCfg[Motor_i],request,sizeof(HardwareMotor)); + MotorsCfg[Motor_i].configword = request->configword; + MotorsCfg[Motor_i].hardwaremotortype = request->hardwaremotortype; + MotorsCfg[Motor_i].minfrequency = request->minfrequency; + MotorsCfg[Motor_i].maxfrequency = request->maxfrequency; + MotorsCfg[Motor_i].setmicrostep = request->setmicrostep; + MotorsCfg[Motor_i].microstep = request->microstep; + MotorsCfg[Motor_i].maxchangeslope = request->maxchangeslope; + MotorsCfg[Motor_i].highlengthmicrosecond = request->highlengthmicrosecond; + MotorsCfg[Motor_i].speedmaster = request->speedmaster; + MotorsCfg[Motor_i].pulseperround = request->pulseperround; + MotorsCfg[Motor_i].pulleyradius = request->pulleyradius; + MotorsCfg[Motor_i].configword = request->configword; + MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize; + MotorsCfg[Motor_i].kvalhold = request->kvalhold; + MotorsCfg[Motor_i].kvalrun = request->kvalrun; + MotorsCfg[Motor_i].kvalacc = request->kvalacc; + MotorsCfg[Motor_i].kvaldec = request->kvaldec; + MotorsCfg[Motor_i].overcurrentthreshold = request->overcurrentthreshold; + MotorsCfg[Motor_i].stallthreshold = request->stallthreshold; + MotorsCfg[Motor_i].thermalcompensationfactor = request->thermalcompensationfactor; + MotorsCfg[Motor_i].lowspeedoptimization = request->lowspeedoptimization; + MotorsCfg[Motor_i].stslp = request->stslp; + MotorsCfg[Motor_i].intspd = request->intspd; + MotorsCfg[Motor_i].fnslpacc = request->fnslpacc; + MotorsCfg[Motor_i].fnslpdec = request->fnslpdec; + MotorsCfg[Motor_i].fsspd = request->fsspd; status = MotorConfig( Motor_i, &MotorsCfg[Motor_i]); // if (Motor_i == MOTOR_RDRIVING) |
