mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Cleanup
This commit is contained in:
@@ -17,9 +17,7 @@ extern "C" {
|
|||||||
SemaphoreHandle_t FRToSI2C::I2CSemaphore = nullptr;
|
SemaphoreHandle_t FRToSI2C::I2CSemaphore = nullptr;
|
||||||
StaticSemaphore_t FRToSI2C::xSemaphoreBuffer;
|
StaticSemaphore_t FRToSI2C::xSemaphoreBuffer;
|
||||||
#define I2C_TIME_OUT (uint16_t)(12000)
|
#define I2C_TIME_OUT (uint16_t)(12000)
|
||||||
void FRToSI2C::CpltCallback() {
|
void FRToSI2C::CpltCallback() {} // Not used
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FRToSI2C::I2C_RegisterWrite(uint8_t address, uint8_t reg, uint8_t data) { return Mem_Write(address, reg, &data, 1); }
|
bool FRToSI2C::I2C_RegisterWrite(uint8_t address, uint8_t reg, uint8_t data) { return Mem_Write(address, reg, &data, 1); }
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ void setTipPWM(const uint8_t pulse, const bool shouldUseFastModePWM) {
|
|||||||
// disabled if the PID task is not scheduled often enough.
|
// disabled if the PID task is not scheduled often enough.
|
||||||
pendingPWM = pulse;
|
pendingPWM = pulse;
|
||||||
fastPWM = shouldUseFastModePWM;
|
fastPWM = shouldUseFastModePWM;
|
||||||
MSG((char *)"PWM Output %d, %d\r\n", pulse, (int)shouldUseFastModePWM);
|
// MSG((char *)"PWM Output %d, %d\r\n", pulse, (int)shouldUseFastModePWM);
|
||||||
}
|
}
|
||||||
extern osThreadId POWTaskHandle;
|
extern osThreadId POWTaskHandle;
|
||||||
|
|
||||||
@@ -213,10 +213,14 @@ bool getFUS302IRQLow() {
|
|||||||
return false;
|
return false;
|
||||||
// return (RESET == gpio_input_bit_get(FUSB302_IRQ_GPIO_Port, FUSB302_IRQ_Pin));
|
// return (RESET == gpio_input_bit_get(FUSB302_IRQ_GPIO_Port, FUSB302_IRQ_Pin));
|
||||||
}
|
}
|
||||||
|
uint16_t rescaleADC(const uint16_t value) {
|
||||||
|
uint32_t temp = value * 33;
|
||||||
|
uint16_t res = temp / 32;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
uint16_t getADCHandleTemp(uint8_t sample) { return rescaleADC(ADC_Temp.average() >> 1); }
|
||||||
|
|
||||||
uint16_t getADCHandleTemp(uint8_t sample) { return ADC_Temp.average() >> 1; }
|
uint16_t getADCVin(uint8_t sample) { return rescaleADC(ADC_Vin.average() >> 1); }
|
||||||
|
|
||||||
uint16_t getADCVin(uint8_t sample) { return ADC_Vin.average() >> 1; }
|
|
||||||
|
|
||||||
// Returns either average or instant value. When sample is set the samples from the injected ADC are copied to the filter and then the raw reading is returned
|
// Returns either average or instant value. When sample is set the samples from the injected ADC are copied to the filter and then the raw reading is returned
|
||||||
uint16_t getTipRawTemp(uint8_t sample) { return ADC_Tip.average() >> 2; }
|
uint16_t getTipRawTemp(uint8_t sample) { return rescaleADC(ADC_Tip.average() >> 2); }
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ void startPOWTask(void const *argument __unused) {
|
|||||||
#endif
|
#endif
|
||||||
BaseType_t res;
|
BaseType_t res;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
MSG((char *)"POW Spin\r\n");
|
|
||||||
res = pdFALSE;
|
res = pdFALSE;
|
||||||
// While the interrupt is low, dont delay
|
// While the interrupt is low, dont delay
|
||||||
/*This is due to a possible race condition, where:
|
/*This is due to a possible race condition, where:
|
||||||
|
|||||||
Reference in New Issue
Block a user