/*---------------------------------------------------------------------------- * Thread 'LED_Thread': Toggles LED *---------------------------------------------------------------------------*/ void Thread_Temp (void const *argument) { while(1){ osDelay(1000); HAL_ADC_Start(&ADCHandleinit); HAL_ADC_PollForConversion(&ADCHandleinit, 10); rawValue = HAL_ADC_GetValue(&ADCHandleinit); convertedValue[0] = tempConv(rawValue); if(convertedValue[0] > 38) overHeat = 1; else overHeat = 0; __HAL_ADC_CLEAR_FLAG(&ADCHandleinit,ADC_FLAG_EOC); } }
/* re-write of tempearature conversion using function */ main() { tempConv(); }