Rev 50 | Rev 53 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 50 | Rev 52 | ||
---|---|---|---|
Line 73... | Line 73... | ||
73 | 73 | ||
74 | UART_HandleTypeDef huart1; |
74 | UART_HandleTypeDef huart1; |
75 | 75 | ||
76 | /* USER CODE BEGIN PV */ |
76 | /* USER CODE BEGIN PV */ |
77 | 77 | ||
78 | volatile char TimerFlag = 0; |
- | |
79 | - | ||
80 | volatile char NoSerialInCTR = 0; // Missing characters coming in on USART1 |
- | |
81 | volatile char NoSerialIn = 0; |
- | |
82 | - | ||
83 | // storage for ADC |
78 | // storage for ADC |
84 | uint16_t ADC_Samples[ADC_CHANNELS] = {[0 ... ADC_CHANNELS - 1] = 0}; |
79 | uint16_t ADC_Samples[ADC_CHANNELS] = {[0 ... ADC_CHANNELS - 1] = 0}; |
85 | 80 | ||
86 | uint32_t FILT_Samples[ADC_CHANNELS] = {[0 ... ADC_CHANNELS - 1] = 0}; // filtered ADC samples * Scale |
81 | uint32_t FILT_Samples[ADC_CHANNELS] = {[0 ... ADC_CHANNELS - 1] = 0}; // filtered ADC samples * Scale |
87 | 82 | ||
Line 336... | Line 331... | ||
336 | plx_sendword(PLX_Timing); |
331 | plx_sendword(PLX_Timing); |
337 | PutCharSerial(&uc1, libPLXgetNextInstance(PLX_Timing)); |
332 | PutCharSerial(&uc1, libPLXgetNextInstance(PLX_Timing)); |
338 | plx_sendword(64 - 15); // make it negative |
333 | plx_sendword(64 - 15); // make it negative |
339 | } |
334 | } |
340 | 335 | ||
341 | void libPLXcallbackResetSerialTimeout() |
- | |
342 | { |
- | |
343 | resetSerialTimeout(); |
- | |
344 | TimerFlag = 0; |
- | |
345 | } |
- | |
346 | 336 | ||
347 | void libPLXcallbackSendUserData() |
337 | void libPLXcallbackSendUserData() |
348 | { |
338 | { |
349 | // send the observations |
339 | // send the observations |
350 | ProcessRPM(); |
340 | ProcessRPM(); |
Line 497... | Line 487... | ||
497 | } |
487 | } |
498 | 488 | ||
499 | // check to see if we have any incoming data, copy and append if so, if no data then create our own frames. |
489 | // check to see if we have any incoming data, copy and append if so, if no data then create our own frames. |
500 | 490 | ||
501 | // poll the input data and produce automatic output if the timer expires and no serial input data |
491 | // poll the input data and produce automatic output if the timer expires and no serial input data |
502 | libPLXpollData(&uc1, TimerFlag && NoSerialIn); |
492 | libPLXpollData(&uc1); |
503 | } |
493 | } |
504 | 494 | ||
505 | /* USER CODE END 3 */ |
495 | /* USER CODE END 3 */ |
506 | } |
496 | } |
507 | 497 |