Mercurial > public > ostc4
comparison Small_CPU/Src/scheduler.c @ 802:91d5ef16f1fd
Removed dependency to protocol setting:
In the first implementation sensors had been selected by switching protocol options. With introduction of the autodetection and sensor map this approach has become obsolete => Removed actions which were derived using the protocol setting.
author | Ideenmodellierer |
---|---|
date | Thu, 10 Aug 2023 21:27:58 +0200 |
parents | bb37d4f3e50e |
children | d32901746950 |
comparison
equal
deleted
inserted
replaced
801:ff66b41d6fe4 | 802:91d5ef16f1fd |
---|---|
316 if(((global.dataSendToSlave.data.externalInterface_Cmd & EXT_INTERFACE_ADC_ON) != 0) != externalInterface_isEnabledADC()) | 316 if(((global.dataSendToSlave.data.externalInterface_Cmd & EXT_INTERFACE_ADC_ON) != 0) != externalInterface_isEnabledADC()) |
317 { | 317 { |
318 externalInterface_SwitchADC(1-externalInterface_isEnabledADC()); | 318 externalInterface_SwitchADC(1-externalInterface_isEnabledADC()); |
319 } | 319 } |
320 | 320 |
321 if(((global.dataSendToSlave.data.externalInterface_Cmd >> 8) & 0x0F) != externalInterface_GetUARTProtocol()) | |
322 { | |
323 externalInterface_SwitchUART((global.dataSendToSlave.data.externalInterface_Cmd >> 8) & 0x0F); | |
324 } | |
325 | |
326 externalInface_SetSensorMap(global.dataSendToSlave.data.externalInterface_SensorMap); | 321 externalInface_SetSensorMap(global.dataSendToSlave.data.externalInterface_SensorMap); |
327 if(global.dataSendToSlave.data.externalInterface_Cmd & 0x00FF) /* lowest nibble for commands */ | 322 if(global.dataSendToSlave.data.externalInterface_Cmd & 0x00FF) /* lowest nibble for commands */ |
328 { | 323 { |
329 externalInterface_ExecuteCmd(global.dataSendToSlave.data.externalInterface_Cmd); | 324 externalInterface_ExecuteCmd(global.dataSendToSlave.data.externalInterface_Cmd); |
330 } | 325 } |
514 while(global.mode == MODE_DIVE) | 509 while(global.mode == MODE_DIVE) |
515 { | 510 { |
516 lasttick = HAL_GetTick(); | 511 lasttick = HAL_GetTick(); |
517 ticksdiff = time_elapsed_ms(Scheduler.tickstart,lasttick); | 512 ticksdiff = time_elapsed_ms(Scheduler.tickstart,lasttick); |
518 | 513 |
519 if(externalInterface_GetUARTProtocol() != 0) | 514 externalInterface_HandleUART(); |
520 { | |
521 externalInterface_HandleUART(); | |
522 } | |
523 | |
524 if(ticksdiff >= Scheduler.counterSPIdata100msec * 100 + 10) | 515 if(ticksdiff >= Scheduler.counterSPIdata100msec * 100 + 10) |
525 { | 516 { |
526 if(SPI_Evaluate_RX_Data()!=0) /* did we receive something ? */ | 517 if(SPI_Evaluate_RX_Data()!=0) /* did we receive something ? */ |
527 { | 518 { |
528 Scheduler.counterSPIdata100msec++; | 519 Scheduler.counterSPIdata100msec++; |
824 { | 815 { |
825 if(scheduleSetButtonResponsiveness()) | 816 if(scheduleSetButtonResponsiveness()) |
826 setButtonsNow = 0; | 817 setButtonsNow = 0; |
827 } | 818 } |
828 | 819 |
829 if(externalInterface_GetUARTProtocol() != 0) | 820 externalInterface_HandleUART(); |
830 { | |
831 externalInterface_HandleUART(); | |
832 } | |
833 | 821 |
834 /* Evaluate received data at 10 ms, 110 ms, 210 ms,... duration ~<1ms */ | 822 /* Evaluate received data at 10 ms, 110 ms, 210 ms,... duration ~<1ms */ |
835 if(ticksdiff >= Scheduler.counterSPIdata100msec * 100 + 10) | 823 if(ticksdiff >= Scheduler.counterSPIdata100msec * 100 + 10) |
836 { | 824 { |
837 if(SPI_Evaluate_RX_Data()!=0) /* did we receive something ? */ | 825 if(SPI_Evaluate_RX_Data()!=0) /* did we receive something ? */ |