Changeset 66 for ctrl/firmware/Main/SES/Core
- Timestamp:
- Jan 22, 2025, 11:40:26 AM (4 days ago)
- Location:
- ctrl/firmware/Main/SES/Core
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ctrl/firmware/Main/SES/Core/Inc/utils.h
r64 r66 2 2 #define __UTILS_H 3 3 4 #include <utility> 5 4 6 void printThreadStackInfo(const char* const TAG); 5 7 8 // This function converts all numbers from range [x0, x1] to range [y0, y1] 9 template <typename TYPE> TYPE Rescale(TYPE x, TYPE x1, TYPE x2, TYPE y1, TYPE y2, bool doNotExtrapolate = true) 10 { 11 if (x1 > x2) std::swap(x1, x2); 12 if (y1 > y2) std::swap(y1, y2); 13 14 if (doNotExtrapolate) 15 { 16 if (x > x2) return y2; 17 if (x < x1) return y1; 18 } 19 //SEGGER_RTT_printf(0, "x0 = %d, x1 = %d\n", x0, x1); 20 return (((y2 - y1)*(x - x1))/(x2 - x1) + y1); 21 } 22 23 6 24 #endif /* __UTILS_H */ -
ctrl/firmware/Main/SES/Core/Src/gsm_rx_thread.cpp
r65 r66 28 28 { 29 29 (void)initial_input; 30 31 30 extern DMA_HandleTypeDef hdma_usart3_rx; 32 31
Note: See TracChangeset
for help on using the changeset viewer.