Mercurial > public > ostc4
diff Small_CPU/Src/i2c.c @ 84:e6abbef57475 kittz
Remove unusable code!!! prepare data for SPI in ONLY 1 IRQ!!!!
author | Dmitry Romanov <kitt@bk.ru> |
---|---|
date | Wed, 21 Nov 2018 10:25:15 +0300 |
parents | a6f0881074a4 |
children | 3db7389d49cc |
line wrap: on
line diff
--- a/Small_CPU/Src/i2c.c Tue Nov 20 12:27:40 2018 +0300 +++ b/Small_CPU/Src/i2c.c Wed Nov 21 10:25:15 2018 +0300 @@ -76,17 +76,16 @@ I2cHandle.Init.NoStretchMode = I2C_NOSTRETCH_DISABLED; I2cHandle.Init.OwnAddress1 = 0x01; - global.dataSendToSlaveStopEval = 1; global.I2C_SystemStatus = HAL_I2C_Init(&I2cHandle); HAL_I2CEx_AnalogFilter_Config(&I2cHandle, I2C_ANALOGFILTER_ENABLED); - global.dataSendToSlaveStopEval = 0; - if(global.dataSendToSlavePending) - { - scheduleSpecial_Evaluate_DataSendToSlave(); - } +// if(global.dataSendToSlavePending) +// { +// scheduleSpecial_Evaluate_DataSendToSlave(); +// } + global.dataUpdateIsNeeded = 1; return (HAL_StatusTypeDef)global.I2C_SystemStatus; } @@ -110,18 +109,19 @@ if(global.I2C_SystemStatus != HAL_OK) return (HAL_StatusTypeDef)global.I2C_SystemStatus; - global.dataSendToSlaveStopEval = 1; + global.I2C_SystemStatus = HAL_I2C_Master_Transmit(&I2cHandle, DevAddress, pData, Size, 100 /*FIXME , 0*/); if(global.I2C_SystemStatus != HAL_OK) { I2C_Error_count(); } - global.dataSendToSlaveStopEval = 0; - if(global.dataSendToSlavePending) - { - scheduleSpecial_Evaluate_DataSendToSlave(); - } + +// if(global.dataSendToSlavePending) +// { +// scheduleSpecial_Evaluate_DataSendToSlave(); +// } + global.dataUpdateIsNeeded = 1; return (HAL_StatusTypeDef)global.I2C_SystemStatus; } @@ -132,7 +132,7 @@ return (HAL_StatusTypeDef)(global.I2C_SystemStatus & 0x03); - global.dataSendToSlaveStopEval = 1; + global.I2C_SystemStatus = HAL_I2C_Master_Transmit(&I2cHandle, DevAddress, pData, Size, 100 /*FIXME , 1*/); if(global.I2C_SystemStatus != HAL_OK) @@ -140,12 +140,12 @@ I2C_Error_count(); } - global.dataSendToSlaveStopEval = 0; - if(global.dataSendToSlavePending) - { - scheduleSpecial_Evaluate_DataSendToSlave(); - } - +// if(global.dataSendToSlavePending) +// { +// scheduleSpecial_Evaluate_DataSendToSlave(); +// } +// + global.dataUpdateIsNeeded = 1; return (HAL_StatusTypeDef)global.I2C_SystemStatus; } @@ -157,7 +157,6 @@ uint8_t localHALstatusReturn = 0xFF; - global.dataSendToSlaveStopEval = 1; localHALstatusReturn = HAL_I2C_Master_Receive(&I2cHandle, DevAddress, pData, Size, 100); if(localHALstatusReturn != HAL_OK) @@ -165,11 +164,11 @@ I2C_Error_count(); } - global.dataSendToSlaveStopEval = 0; - if(global.dataSendToSlavePending) - { - scheduleSpecial_Evaluate_DataSendToSlave(); - } + global.dataUpdateIsNeeded = 1; +// if(global.dataSendToSlavePending) +// { +// scheduleSpecial_Evaluate_DataSendToSlave(); +// } return (HAL_StatusTypeDef)localHALstatusReturn; }