Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1.  
  2. #define DEBUG_BUTTON_NB_SAMPLES 20
  3. #define DEBUG_BUTTON_NB_KEY 7
  4.  
  5. // Each line correspond to the key ID, the first column is the most recent value
  6. uint16_t au16DebugButtonMeasure[7][DEBUG_BUTTON_NB_SAMPLES];
  7. uint16_t au16DebugButtonReference[7][DEBUG_BUTTON_NB_SAMPLES];
  8.  
  9. void buts_debugShiftAdd(uint8_t u8KeyNb)
  10. {
  11. uint16_t *u16Local1DMes = (uint16_t *)au16DebugButtonMeasure[u8KeyNb];
  12. uint16_t *u16Local1DRef = (uint16_t *)au16DebugButtonReference[u8KeyNb];
  13. if (u8KeyNb < DEBUG_BUTTON_NB_KEY)
  14. {
  15. memmove(&u16Local1DMes[0], &u16Local1DMes[1], (DEBUG_BUTTON_NB_SAMPLES-1) * sizeof (*u16Local1DMes));
  16. memmove(&u16Local1DRef[0], &u16Local1DRef[1], (DEBUG_BUTTON_NB_SAMPLES-1) * sizeof (*u16Local1DRef));
  17.  
  18. au16DebugButtonMeasure[u8KeyNb][DEBUG_BUTTON_NB_SAMPLES-1] = MyTKeys[u8KeyNb].p_ChD->Meas;
  19. au16DebugButtonReference[u8KeyNb][DEBUG_BUTTON_NB_SAMPLES-1] = MyTKeys[u8KeyNb].p_ChD->Ref;
  20. }
  21. else {} //this key does not exist
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement