diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-01-30 11:53:08 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-01-30 11:53:08 +0200 |
| commit | 35ca91ca151dfbbe7e4ec560dca5630a8d7113e1 (patch) | |
| tree | 0e6644bca8ce253c452e43e701af1b6c0bf51275 /Software/Embedded_SW | |
| parent | 99554aaefd61f29be38669d46c7e4a573bec311f (diff) | |
| download | Tango-35ca91ca151dfbbe7e4ec560dca5630a8d7113e1.tar.gz Tango-35ca91ca151dfbbe7e4ec560dca5630a8d7113e1.zip | |
Read ADC - one at a time. update stubs from Mati
Diffstat (limited to 'Software/Embedded_SW')
3 files changed, 12 insertions, 13 deletions
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 cf83373b5..bfc3cc8cd 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -135,13 +135,13 @@ uint8_t FPGA_SPI_Receive(TimerMotors_t _motorId) //---------------- GET ------------------------------ -uint32_t Read_Motors_Driver_Type() +uint32_t Read_Motors_Driver_Type(TimerMotors_t i) { uint32_t status = OK; - TimerMotors_t i = HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD; + //TimerMotors_t i = HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD; - for(i=HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD;i<NUM_OF_MOTORS;i++) + //for(i=HARDWARE_MOTOR_TYPE__MOTO_DH_CLEANHEAD;i<NUM_OF_MOTORS;i++) { Fpga_Spi[i].TX_MOSI = (x_GET_PARAM | x_ADC_OUT)<<8; FPGA_SPI_Transnit(i); @@ -390,6 +390,7 @@ typedef enum { MOTOR_CONFIG_INIT, MOTOR_CONFIG_HARD_HIZ, + MOTOR_CONFIG_READ_ADC, MOTOR_CONFIG_ACC, MOTOR_CONFIG_DEC, MOTOR_CONFIG_MIN_SPEED, @@ -455,13 +456,18 @@ uint32_t FPGA_MotorConfig_callback(TimerMotors_t _motorId, uint32_t ReadValue) char CM_VM = 0; if (_motorId > NUM_OF_MOTORS) return ERROR; - if(Motor_Type_Flag == 0) +/* if(Motor_Type_Flag == 0) { Read_Motors_Driver_Type(); Motor_Type_Flag = 1; - } + }*/ + switch (ConfigStages[_motorId]) { + case MOTOR_CONFIG_READ_ADC: + ConfigStages[_motorId]++; + Read_Motors_Driver_Type(_motorId); + //intentional fall through case MOTOR_CONFIG_ACC: ConfigStages[_motorId]++; temp = x_SET_PARAM | x_ACC; diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h index e23f3be90..e3ea0babe 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.h @@ -10,7 +10,7 @@ void FPGA_GetMotSpeed(SPI MotFPGA_Spi); uint8_t FPGA_SPI_Transnit(TimerMotors_t _motorId); uint8_t FPGA_SPI_Receive(TimerMotors_t _motorId); -uint32_t Read_Motors_Driver_Type(); +uint32_t Read_Motors_Driver_Type(TimerMotors_t i); void FPGA_GetClrMotStat_Cmd(TimerMotors_t _motorId); void FPGA_GetMotSpeed_Cmd(TimerMotors_t _motorId); void FPGA_Get_ADC_OUT_Cmd(TimerMotors_t _motorId); diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c index bc3630698..04f262aa7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsJogging.c @@ -4,13 +4,6 @@ * Created on: 16 aug 2018 * Author: shlomo */ -/* - * DiagnosticsHoming.c - - * - * Created on: July 29 2018 - * Author: shlomo - */ #include <DataDef.h> #include "include.h" |
