aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Software/Embedded_SW/Embedded/DataDef.h1
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c14
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h3
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c18
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.h3
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.c167
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h13
-rw-r--r--Software/Embedded_SW/Embedded/Main.c9
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c33
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h1
-rw-r--r--Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c6
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.c4
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c2
-rw-r--r--Software/Stubs Collection/stubs/Scripts/WHS_Test_EEPROM.cs4
14 files changed, 128 insertions, 150 deletions
diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h
index e87d406c8..fa3feb5cb 100644
--- a/Software/Embedded_SW/Embedded/DataDef.h
+++ b/Software/Embedded_SW/Embedded/DataDef.h
@@ -43,7 +43,6 @@ extern bool Special_Dispensers;
//#define Use_WHS_Card //for real card only
#define USE_OLD_HEAD_EEPROM
-//#define USE_SHINKO_AUTO_COMM //Temporary
//#define USE_RFID
//#define USE_VOC_BUZZER_ALARM
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c
index ce462876b..ea804fc04 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c
@@ -84,6 +84,7 @@ typedef enum
WHS_SET_CLEAN_AIR,
WHS_I2C_EEPROM_WRITE,
WHS_I2C_EEPROM_READ,
+ WHS_I2C_RS485_DIRECTION_INIT,
WHS_I2C_RS485_DIRECTION,
WHS_stop
}I2C_ReadingMessages;
@@ -621,6 +622,16 @@ void Trigger_RS485_Direction(bool TX_OR_RX)
return;
}
+void Trigger_RS485_Direction_Init()
+{
+ I2C_ReadingMessageStruc I2C_ReadingMessage;
+
+ I2C_ReadingMessage.messageId = WHS_I2C_RS485_DIRECTION_INIT;
+ if (I2C_ReadingMsgQ != NULL)
+ Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT);
+ return;
+}
+
void I2C_ReadingTask(UArg arg0, UArg arg1);
void I2C_ReadingTask_Init(void)
{
@@ -837,6 +848,9 @@ void I2C_ReadingTask(UArg arg0, UArg arg1)
case WHS_I2C_EEPROM_READ: //
WHS_I2C_EEprom_Read(I2C_ReadingMessage.parameter, I2C_ReadingMessage.parameter2, I2C_ReadingMessage.parameter3);
break;
+ case WHS_I2C_RS485_DIRECTION_INIT:
+ WHS_IO_RS485_Init();
+ break;
case WHS_I2C_RS485_DIRECTION:
RS485_Change_Direction(I2C_ReadingMessage.parameter);
break;
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h
index 7aab3b448..387a8f692 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h
@@ -18,6 +18,9 @@ void Trigger_WHS_MAX11614_Init(void);
void Trigger_WHS_Rheostat_init(void);
void Trigger_WHS_I2C_EEprom_Write(uint32_t address, uint16_t size, uint8_t *p_data);
void Trigger_WHS_I2C_EEprom_Read(uint32_t address, uint16_t size, uint8_t *p_data);
+void Trigger_RS485_Direction_Init();
+void Trigger_RS485_Direction(bool TX_OR_RX);
+
void Trigger_SetWHSFanSpeed (uint8_t fan_id, uint8_t speed);
void Trigger_ReadWHSFanTacho (uint8_t fan_id); //todo
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c
index 5ce04aab9..3e36d3bba 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.c
@@ -13,6 +13,7 @@
#include <Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.h>
#include <Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/TCA9555_Driver.h>
#include <Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.h>
+#include <Drivers/I2C_Communication/I2C_Task.h>
WHS_I2C_EXP_U3_0x40_DIRECTION Whs_I2C_EXP_U3_0x40_DIRECTION;
@@ -210,6 +211,17 @@ bool WHS_IO_Init()
return status;
}
+bool WHS_IO_RS485_Init()
+{
+ bool status = OK;
+
+ Whs_I2C_EXP_U4_0x42_DIRECTION.bits.OUTPUT_ACTLOW_DE_REn = D_TCA9555_DIR_OUTPUT; //P00
+
+ WHS_TCA9555Config(I2CExp2_ADDRESS);//direction
+
+ return status;
+}
+
bool WHS_IO_Init_HW_0()
{
@@ -717,12 +729,12 @@ uint8_t RS485_Change_Direction(bool TX_OR_RX)//TX or RX - trigger i2c task
uint8_t RS485_Direction(bool TX_OR_RX)//TX or RX
{
- if(TX_OR_RX == TX)
+/* if(TX_OR_RX == TX)
Write_WHS_9555_io_value(I2CExp2_ADDRESS, D_TCA9555_PORT_0, 0, true);
else
Write_WHS_9555_io_value(I2CExp2_ADDRESS, D_TCA9555_PORT_0, 0, false);
-
- //RS485_Change_Direction(TX_OR_RX);
+*/
+ Trigger_RS485_Direction(TX_OR_RX);
return OK;
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.h
index e017bb14a..155e5f2aa 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.h
@@ -1,5 +1,5 @@
/*
- * WHD_IO.h
+ * WHS_IO.h
*
* Created on: Jun 30, 2019
* Author: Shai
@@ -164,6 +164,7 @@ extern WHS_I2C_EXP_U4_0x42_VALUE Whs_I2C_EXP_U4_0x42_VALUE;
bool WHS_IO_Init();
+bool WHS_IO_RS485_Init();
bool WHS_TCA9555Config(uint8_t TCA9555_ADDRESS);
bool Write_WHS_9555_io_value(uint8_t addr, uint8_t port, uint8_t pin, bool value);
bool WHS_Write_IO_AllReg(uint8_t TCA9555_ADDRESS);
diff --git a/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.c b/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.c
index ebefafbdd..36bef086d 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.c
@@ -25,13 +25,14 @@
#include "drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h"
#include "Modules/Control/MillisecTask.h"
#include <DataDef.h>
+#include <Drivers/I2C_Communication/I2C_Task.h>
//uint8_t Uart3_Tx_Buff[100];
//uint8_t Uart3_Rx_Buff[100];
-void InitConsole_WHS_UART3(void)
+void InitConsole_WHS_UART3(int32_t ui32SysClock)
{
- uint32_t ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), SYS_CLK_FREQ);
+ //uint32_t ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), SYS_CLK_FREQ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
//
@@ -78,17 +79,17 @@ void InitConsole_WHS_UART3(void)
//ROM_UARTConfigSetExpClk(UART3_BASE,ROM_SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8| UART_CONFIG_STOP_ONE |UART_CONFIG_PAR_NONE));
//MAP_UARTConfigSetExpClk(UART3_BASE, ui32SysClock, 9600,(UART_CONFIG_WLEN_8 |UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
MAP_UARTConfigSetExpClk(UART3_BASE, ui32SysClock, 9600,(UART_CONFIG_WLEN_7 |UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_EVEN));//Shinko protocol
-
-
-
}
+int Uart3TransmitResult = 0;
uint8_t Uart3_Transmit(uint8_t * Uart3_Tx_Buff, uint32_t Length)
{
uint8_t i,Status = OK;
+ Uart3TransmitResult = 0;
+
uint8_t temp_buf[Size_Shinko_Req];
for(i = 1;i < Length;i++) //swap the order to switch endianness - need to send the LSB first
@@ -100,7 +101,7 @@ uint8_t Uart3_Transmit(uint8_t * Uart3_Tx_Buff, uint32_t Length)
for(i=0;i<Length-1;i++)
{
- ROM_UARTCharPut/*NonBlocking*/(UART3_BASE,temp_buf[i]);//send data
+ Uart3TransmitResult |=ROM_UARTCharPutNonBlocking(UART3_BASE,temp_buf[i]);//send data
}
return Status;
@@ -112,16 +113,23 @@ uint8_t Uart3_Receive(uint8_t * Uart3_Rx_Buff, uint32_t RX_Length)
uint8_t temp_buf[Size_Shinko_Res];
- for(i=0;i<RX_Length;i++)
+ if(Uart3TransmitResult != 0)
{
- temp_buf[i] = ROM_UARTCharGet/*NonBlocking*/(UART3_BASE);//Receive data
- if ((i == 0) && (temp_buf[0] == 0) )// There isn't communication / The controller is not connected - Shinko_Header_Asccii_ACK = 0x06
+ for(i=0;i<RX_Length;i++)
{
- #warning Add error / block communication
- Status = ERROR;
- break;
+ temp_buf[i] = ROM_UARTCharGet/*NonBlocking*/(UART3_BASE);//Receive data
+ if ((i == 0) && (temp_buf[0] == 0) )// There isn't communication / The controller is not connected - Shinko_Header_Asccii_ACK = 0x06
+ {
+ Status = ERROR;
+ break;
+ }
}
}
+ else
+ {
+ Status = ERROR;
+ }
+
if(Status == OK)
{
@@ -131,6 +139,10 @@ uint8_t Uart3_Receive(uint8_t * Uart3_Rx_Buff, uint32_t RX_Length)
Uart3_Rx_Buff[Size_Shinko_Res -1 -i] = temp_buf[i];
}
}
+ else
+ {
+ ReportWithPackageFilter(HeatersFilter,"Shinko communication error ",__FILE__,__LINE__,Uart3TransmitResult,RpError, 0,0);
+ }
return Status;
}
@@ -171,29 +183,30 @@ float Test_Uart3(uint8_t test_number)
switch(test_number)
{
case 0: //---------------------------------- test Shinko -----------------------
- WHS_IO_Init();// Done in HWConfigurationInit
- delayms(1);
- InitConsole_WHS_UART3();// Done in HWConfigurationInit
+ //WHS_IO_Init();// Done in HWConfigurationInit
+ WHS_IO_RS485_Init();
delayms(1);
+ //InitConsole_WHS_UART3();// Done in HWConfigurationInit
+ //delayms(1);
break;
case 1: //---------------------------------- Shinko reading temperature -----------------------
//Read_value
RS485_Direction(TX);
- delayms(1);
+ Task_sleep (eOneMillisecond*1);//delayms(1);
Reading_Shinko_Request_PV();
- delayms(15);
+ Task_sleep (eOneMillisecond*15);//delayms(15);
RS485_Direction(RX);
- delayms(5);
+ Task_sleep (eOneMillisecond*5);//delayms(5);
RetVal=Reading_Shinko_Response_PV();
break;
case 2: //---------------------------------- test Shinko -----------------------
//Read_Setup
RS485_Direction(TX);//done in MilisecTask
- delayms(1);
+ Task_sleep (eOneMillisecond*1);//delayms(1);
Reading_Shinko_Request_SV();//done in MilisecTask
- delayms(15);
+ Task_sleep (eOneMillisecond*15);//delayms(15);
RS485_Direction(RX);//done in MilisecTask
- delayms(5);
+ Task_sleep (eOneMillisecond*5);//delayms(5);
RetVal=Reading_Shinko_Response_SV();//done in MilisecTask
break;
case 3: //---------------------------------- test Shinko -----------------------
@@ -279,86 +292,44 @@ unsigned short Calculate_CRC16 ( int Message_Length, char *Message) // for modbu
}
*/
-typedef enum
-{
- Stage_0 = 5, //to start after few sec from power up
- Stage_1 = Stage_0 + 1,
- Stage_2 = Stage_1 + 15,
- Stage_3 = Stage_2 + 5,
-}SHINKO_RW_STAGES_ENUM;
+uint8_t Shinko_Read_Satage = 0, Shinko_first_read = 0;//public
-uint8_t WHS_Shinko_Communication(SHINKO_RW_OPTIONS_ENUM RWOption) //reading every fourth cycle (Set HW, Request, Set HW, Response)
+void Shinko_Cycle_Comm()
{
- //every 10sec start cycle of reading temperature and if there is request R/W the setup
- uint8_t Status = OK;
- static SHINKO_RW_STAGES_ENUM Shinko_Comm_Stage = 0;
- static uint8_t Option = 0;
-
- switch(Shinko_Comm_Stage)
+ if (WHS_Type == WHS_TYPE_NEW)
{
- case Stage_0:
- RS485_Direction(TX);//Set HW for TX
- Option = RWOption;//change the read write option only in stage 0 ! (finish cycle with the same option)
- Report("WHS_Shinko_Communication ", __FILE__,__LINE__,RWOption, RpMessage, Shinko_Comm_Stage, 0);
- Shinko_Comm_Stage++;
- break;
- case Stage_1:
- if(Option == R_SETUP)
- {
- Reading_Shinko_Request_SV();//Send Command
- }
- else
- if(Option == R_Value)
- {
- Reading_Shinko_Request_PV();//Send Command
- }
- else
- if((Option == W_SETUP) && (ShinkoTempDeg.Setup!= 0x00))
- {
- Setting_Shinko_Request_SV();//Send Command
- Shinko_Read = true;//flag to read the setup in the next cycle
- }
- Report("WHS_Shinko_Communication ", __FILE__,__LINE__,RWOption, RpMessage, Shinko_Comm_Stage, 0);
- Shinko_Comm_Stage++;
- break;
- case Stage_2:
- RS485_Direction(RX);//Set HW for RX
- Report("WHS_Shinko_Communication ", __FILE__,__LINE__,RWOption, RpMessage, Shinko_Comm_Stage, 0);
- Shinko_Comm_Stage++;
- break;
- case Stage_3:
- if(Option == R_SETUP)
- {
- Status|=Reading_Shinko_Response_SV();//Get Response
- }
- else
- if(Option == R_Value)
- {
- Status|=Reading_Shinko_Response_PV();//Get Response
- }
- else
- if((Option == W_SETUP) && (ShinkoTempDeg.Setup!= 0x00))
- {
- Status|=Setting_Shinko_Response_SV();//Get Response
- }
- else
- {
- Status = ERROR;
- }
+ if ((Shinko_Read_Satage == 0) || (Shinko_first_read == 0))
+ {
+ //Read_value
+ Trigger_RS485_Direction(TX);
+ Task_sleep (eOneMillisecond*1);//delayms(1);
+ Reading_Shinko_Request_PV();
+ Task_sleep (eOneMillisecond*15);//delayms(15);
+ Trigger_RS485_Direction(RX);
+ Task_sleep (eOneMillisecond*5);//delayms(5);
+ Reading_Shinko_Response_PV();
- Report("WHS_Shinko_Communication ", __FILE__,__LINE__,RWOption, RpMessage, Shinko_Comm_Stage, 0);
- Shinko_Comm_Stage = Stage_0;
- if(Option == RWOption)
- {
- Shinko_Read = false;
- }
- break;
- default:
- //Shinko_Comm_Stage = Stage_0;
- //Shinko_Read = false;
- Shinko_Comm_Stage++;
- break;
- }
+ Shinko_Read_Satage = 1;
+ Shinko_first_read = 1;
+ }
+ else
+ if ((Shinko_Read_Satage == 1) || (Shinko_first_read == 1))
+ {
+ //Read_Setup
+ Trigger_RS485_Direction(TX);//done in MilisecTask
+ Task_sleep (eOneMillisecond*1);//delayms(1);
+ Reading_Shinko_Request_SV();//done in MilisecTask
+ Task_sleep (eOneMillisecond*15);//delayms(15);
+ Trigger_RS485_Direction(RX);//done in MilisecTask
+ Task_sleep (eOneMillisecond*5);//delayms(5);
+ Reading_Shinko_Response_SV();//done in MilisecTask
- return Status;
+ Shinko_Read_Satage = 0;
+ Shinko_first_read = 2;
+ }
+ else
+ {
+ Shinko_Read_Satage = 0;
+ }
+ }
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h b/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h
index 0ce2259d0..9cae7f2a9 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h
+++ b/Software/Embedded_SW/Embedded/Drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h
@@ -8,19 +8,14 @@
#ifndef DRIVERS_UART_COMM_WHS_UART_WHS_UART_H_
#define DRIVERS_UART_COMM_WHS_UART_WHS_UART_H_
-typedef enum
-{
- R_Value,
- R_SETUP,
- W_SETUP
-}SHINKO_RW_OPTIONS_ENUM;
-
uint8_t Uart3_Transmit(uint8_t * Uart3_Tx_Buff, uint32_t Length);
uint8_t Uart3_Receive(uint8_t * Uart3_Rx_Buff, uint32_t RX_Length);
float Test_Uart3(uint8_t test_number);
-void InitConsole_WHS_UART3(void);
+void InitConsole_WHS_UART3(int32_t ui32SysClock);
+
+extern uint8_t Shinko_Read_Satage,Shinko_first_read;
+void Shinko_Cycle_Comm();
-uint8_t WHS_Shinko_Communication(SHINKO_RW_OPTIONS_ENUM RWOption);
#endif /* DRIVERS_UART_COMM_WHS_UART_WHS_UART_H_ */
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c
index 1db7b8541..de91e5b99 100644
--- a/Software/Embedded_SW/Embedded/Main.c
+++ b/Software/Embedded_SW/Embedded/Main.c
@@ -40,6 +40,8 @@
#include <DataDef.h>
#include "Sys_PinOut_Config/MCU_MAIN_pinout.h"
#include <Drivers/I2C_Communication/I2C.h>
+#include "drivers/Uart_Comm/WHS_Controller_Comm/WHS_UART/WHS_Uart.h"
+#include <Drivers/I2C_Communication/WHS_Card/IO_Extender_Ports_TCA9555/WHS_IO.h>
/*
#include "Drivers/SPI_SDCARD/SDSPI.h"
@@ -226,7 +228,6 @@ int main(void)
//Set the clock 120MHz
uint32_t ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), SYS_CLK_FREQ);
-
// Enable the system tick.
ROM_SysTickPeriodSet(ui32SysClock / TICKS_PER_SECOND);
ROM_SysTickIntEnable();
@@ -320,6 +321,12 @@ int main(void)
Set_Speed_Sensor_TypeII_Registers(10,5);//set default values
#endif
+ if (WHS_Type == WHS_TYPE_NEW)
+ {
+ InitConsole_WHS_UART3(ui32SysClock);//Init WHS UART Shinko RS485 Communication
+ Trigger_RS485_Direction_Init();//init i/o
+ }
+
//EMAC_initEMAC();
ControlInit();
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
index d668657b5..ddbda4bca 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c
@@ -598,7 +598,6 @@ void setRapidPressureRead(bool value)
if (GetDiagnosticMode() == Diagnostic_Extreme_Mode)
RapidPressureRead = true;
}
-bool Shinko_Read = false;
uint16_t PumpCounter = 0;
uint16_t realtimetest[101];
uint32_t MillisecLowLoop(uint32_t tick)
@@ -640,6 +639,7 @@ uint32_t MillisecLowLoop(uint32_t tick)
//Screw_ENC_Velocity_to_DAC(); - for testing the screw enc
if (Head_Type > HEAD_TYPE_FLAT_WITHOUT_CARD)
StartPT100 = TEMP_SENSE_ANALOG_DRYER_TEMP1;
+
if (Ten_msTick)
{
//Speed_Data = Read_Speed_Sensor_TypeII();
@@ -738,26 +738,6 @@ uint32_t MillisecLowLoop(uint32_t tick)
if (isMotorConfigured(Motor_i))
MotorGetStatusFromFPGA(Motor_i);
}
-#ifdef USE_SHINKO_AUTO_COMM
- if ((WHS_Type == WHS_TYPE_NEW)&&(Shinko_Read == true))
- {
- if(ShinkoTempDeg.Read_Setup == 0x00)//didn't read it yet
- {
- WHS_Shinko_Communication(R_SETUP);
- }
- else
- /*if(0)//TBD - need stop condition to write only once (all the steps) , Read_Setup != setup, Read_Setup != 0, Read_Setup != Prev_Read_Setup
- {
- // option to wrte + read setup and stop when read = write
- WHS_Shinko_Communication(W_SETUP);
- }
- else*/
- {
- //finish reading the setup before start reading the value
- WHS_Shinko_Communication(R_Value); // Reading every fourth cycle (Set HW, Request, Set HW, Response)
- }
- }
-#endif
}
if ((O500Millisecond_Tick)&&(RapidPressureRead == false))
{
@@ -820,6 +800,11 @@ uint32_t MillisecLowLoop(uint32_t tick)
Whs_emptying_cycle++;
}
*/
+
+ if(Shinko_first_read < 2)//read the two steps once and than in cycle every 10 minutes, also will be used to read after updating the temperature
+ {
+ Shinko_Cycle_Comm();
+ }
}
if (Head_Type == HEAD_TYPE_ARC) {
HeadBlowersControlLoop();
@@ -845,7 +830,6 @@ uint32_t MillisecLowLoop(uint32_t tick)
}
#endif
- Shinko_Read = true;//start cycle of R/W setup or value every 10Sec
}
if (OneMinute_Tick)
{
@@ -876,7 +860,10 @@ uint32_t MillisecLowLoop(uint32_t tick)
{
waste_seq_step1();// include 1Sec delay <- to open !!!!
}*/
-
+ if (WHS_Type == WHS_TYPE_NEW)
+ {
+ Shinko_Cycle_Comm();
+ }
}
if (OneHourTick)
{
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
index f7351d0b1..0d7c42ad6 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
+++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h
@@ -50,7 +50,6 @@ void MillisecLogClose(void);
#endif
-extern bool Shinko_Read;
extern bool watchdogCriticalAlarm;
extern Task_Handle Millisecond_Task_Handle;
diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
index 1defda43c..2f9088cf1 100644
--- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
+++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c
@@ -186,12 +186,6 @@ uint32_t HWConfigurationInit(void)
//WHS_init(); // remove call to old WHS
#endif
- if (WHS_Type == WHS_TYPE_NEW)
- {
-/* WHS_IO_Init();
- Task_sleep(1);//wait for WHS_IO_Init*/
- InitConsole_WHS_UART3();//WHS Shinko communication
- }
// Waste Init (WHS)
Waste_Init();
diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.c b/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.c
index 614fd05eb..070f3c7e7 100644
--- a/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.c
+++ b/Software/Embedded_SW/Embedded/Modules/Waste/newWHS_init.c
@@ -86,10 +86,6 @@ bool newWHS_init(void)
//Set_All_WHS_Fans(0xFF);
// delayms(4000);
//Trigger_SetWHSBlowerVoltage (0x0C00);
- //Task_sleep(1);
- //InitConsole_WHS_UART3();//WHS Shinko communication
-
-
return status;
}
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
index 399831531..71a06cd93 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
@@ -620,7 +620,7 @@ uint32_t InitSequenceStartHeating(void)
TimerMotors_t MotorId = HARDWARE_MOTOR_TYPE__MOTO_DH_LID;
SetMachineReadyForHeating(true);
- Shinko_Read = true;
+
if(Head_Type == HEAD_TYPE_ARC) {
MotorMovetoLimitSwitch(MotorId,1-MotorsCfg[MotorId].directionthreadwize, 30, Motor_Id_to_LS_IdDown[MotorId], cleaningMotorCBFunction,30000);
} else if(Head_Type == HEAD_TYPE_FLAT){
diff --git a/Software/Stubs Collection/stubs/Scripts/WHS_Test_EEPROM.cs b/Software/Stubs Collection/stubs/Scripts/WHS_Test_EEPROM.cs
index 88de4de01..5c3708af7 100644
--- a/Software/Stubs Collection/stubs/Scripts/WHS_Test_EEPROM.cs
+++ b/Software/Stubs Collection/stubs/Scripts/WHS_Test_EEPROM.cs
@@ -12,9 +12,9 @@ using Tango.Stubs;
//----------------------
const Int32 I2C_ID = 3; //MCU_I2C3
-const Int32 TCA9548A_address = 0xE2;
+const Int32 TCA9548A_address = 0xE0;
const Int32 I2C_Slave_Add = 0xA0; // //eeprom address - 32kByte
-int Head_Mux_Channel_ID = 0; //WHS MUX channel
+int Head_Mux_Channel_ID = 1; //WHS MUX channel
//----------------------