Ignore:
Timestamp:
Jan 22, 2025, 11:40:26 AM (4 days ago)
Author:
Zed
Message:

FAN PWM control and TACHO signal measuring are working.

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  
    22#define __UTILS_H
    33
     4#include <utility>
     5
    46void printThreadStackInfo(const char* const TAG);
    57
     8// This function converts all numbers from range [x0, x1] to range [y0, y1]
     9template <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
    624#endif /* __UTILS_H */
  • ctrl/firmware/Main/SES/Core/Src/gsm_rx_thread.cpp

    r65 r66  
    2828{
    2929        (void)initial_input;
    30 
    3130        extern DMA_HandleTypeDef hdma_usart3_rx;
    3231
Note: See TracChangeset for help on using the changeset viewer.