Mercurial > public > ostc4
diff Small_CPU/Src/scheduler.c @ 181:331882a89421 Cleanup_Compass_Wireless
Removed not suppoted wireless feature
The code contains parts of a wireless sensor feature which is not supported by the OSTC4 hardware.
author | ideenmodellierer |
---|---|
date | Wed, 13 Mar 2019 21:51:25 +0100 |
parents | c659fda83e44 |
children | f11f0bf6ef2d |
line wrap: on
line diff
--- a/Small_CPU/Src/scheduler.c Wed Mar 13 21:49:25 2019 +0100 +++ b/Small_CPU/Src/scheduler.c Wed Mar 13 21:51:25 2019 +0100 @@ -40,7 +40,6 @@ #include "calc_crush.h" #include "stm32f4xx_hal_rtc_ex.h" #include "decom.h" -#include "wireless.h" #include "tm_stm32f4_otp.h" @@ -87,8 +86,6 @@ void copyTissueData(void); void copyVpmCrushingData(void); void copyDeviceData(void); -void changeAgeWirelessData(void); -void copyWirelessData(void); void copyPICdata(void); uint16_t schedule_update_timer_helper(int8_t thisSeconds); @@ -478,7 +475,6 @@ Scheduler.counterCompass100msec = 0; Scheduler.counterPressure100msec = 0; Scheduler.counterAmbientLight100msec = 0; - Scheduler.counterWireless1msec = 0; global.deviceData.diveCycles.value_int32++; scheduleSetDate(&global.deviceData.diveCycles); @@ -490,19 +486,6 @@ lasttick = HAL_GetTick(); ticksdiff = time_elapsed_ms(Scheduler.tickstart,lasttick); - - //Evaluate wireless data every ms, if present - if(ticksdiff > Scheduler.counterWireless1msec) - { - Scheduler.counterWireless1msec++; - changeAgeWirelessData(); - global.wirelessReceived = wireless_evaluate(global.wirelessdata,MAX_WIRELESS_BYTES, &global.wirelessConfidenceStatus); - if((global.wirelessReceived > 0) && !wireless_evaluate_crc_error(global.wirelessdata,global.wirelessReceived)) - { - copyWirelessData(); - } - } - if(ticksdiff >= Scheduler.counterSPIdata100msec * 100 + 10) { SPI_Evaluate_RX_Data(); @@ -666,7 +649,6 @@ Scheduler.counterCompass100msec = 0; Scheduler.counterPressure100msec = 0; Scheduler.counterAmbientLight100msec = 0; - Scheduler.counterWireless1msec = 0; } } } @@ -767,7 +749,6 @@ Scheduler.counterCompass100msec = 0; Scheduler.counterPressure100msec = 0; Scheduler.counterAmbientLight100msec = 0; - Scheduler.counterWireless1msec = 0; global.dataSendToMaster.mode = MODE_SURFACE; global.deviceDataSendToMaster.mode = MODE_SURFACE; @@ -780,16 +761,6 @@ lasttick = HAL_GetTick(); ticksdiff = time_elapsed_ms(Scheduler.tickstart,lasttick); - if(ticksdiff > Scheduler.counterWireless1msec) - { - Scheduler.counterWireless1msec++; - changeAgeWirelessData(); - global.wirelessReceived = wireless_evaluate(global.wirelessdata,MAX_WIRELESS_BYTES, &global.wirelessConfidenceStatus); - if((global.wirelessReceived > 0) && !wireless_evaluate_crc_error(global.wirelessdata,global.wirelessReceived)) - { - copyWirelessData(); - } - } if(setButtonsNow == 1) { if(scheduleSetButtonResponsiveness()) @@ -907,7 +878,6 @@ Scheduler.counterCompass100msec = 0; Scheduler.counterPressure100msec = 0; Scheduler.counterAmbientLight100msec = 0; - Scheduler.counterWireless1msec = 0; } } } @@ -922,7 +892,6 @@ Scheduler.counterCompass100msec = 0; Scheduler.counterPressure100msec = 0; Scheduler.counterAmbientLight100msec = 0; - Scheduler.counterWireless1msec = 0; dohardspisync = 0; } } @@ -1519,40 +1488,6 @@ global.deviceDataSendToMaster.boolVpmRepetitiveDataValid = 1; } -void changeAgeWirelessData(void) -{ - for(int i=0;i<4;i++) - { - if(global.dataSendToMaster.data[global.dataSendToMaster.boolWirelessData].wireless_data[i].ageInMilliSeconds) - global.dataSendToMaster.data[global.dataSendToMaster.boolWirelessData].wireless_data[i].ageInMilliSeconds++; - } -} - -void copyWirelessData(void) -{ - uint8_t boolWirelessData = !global.dataSendToMaster.boolWirelessData; - SDataWireless *dataOld, *dataNew; - for(int i=0;i<3;i++) - { - dataNew = &global.dataSendToMaster.data[boolWirelessData].wireless_data[i+1]; - dataOld = &global.dataSendToMaster.data[!boolWirelessData].wireless_data[i]; - dataNew->ageInMilliSeconds = dataOld->ageInMilliSeconds; - dataNew->numberOfBytes = dataOld->numberOfBytes; - dataNew->status = dataOld->status; - memcpy(dataNew->data, dataOld->data,8); - } - - global.dataSendToMaster.data[boolWirelessData].wireless_data[0].ageInMilliSeconds = 1; - global.dataSendToMaster.data[boolWirelessData].wireless_data[0].numberOfBytes = global.wirelessReceived; - global.dataSendToMaster.data[boolWirelessData].wireless_data[0].status = global.wirelessConfidenceStatus; - for(int i=0;i<MAX_WIRELESS_BYTES;i++) - global.dataSendToMaster.data[boolWirelessData].wireless_data[0].data[i] = global.wirelessdata[i]; - for(int i=MAX_WIRELESS_BYTES;i<12;i++) - global.dataSendToMaster.data[boolWirelessData].wireless_data[0].data[i] = 0xFF; - - global.dataSendToMaster.boolWirelessData = boolWirelessData; -} - /* copyPICdata(); is used in spi.c */ void copyPICdata(void) { @@ -1565,8 +1500,6 @@ } - - typedef enum { SPI3_OK = 0x00,