Move IRQ's for easier tracing
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
//BSP mapping functions
|
//BSP mapping functions
|
||||||
|
|
||||||
|
#include <IRQ.h>
|
||||||
#include "BSP.h"
|
#include "BSP.h"
|
||||||
#include "Setup.h"
|
#include "Setup.h"
|
||||||
#include "history.hpp"
|
#include "history.hpp"
|
||||||
@@ -212,41 +213,6 @@ uint8_t getButtonB() {
|
|||||||
1 : 0;
|
1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Catch the IRQ that says that the conversion is done on the temperature
|
|
||||||
* readings coming in Once these have come in we can unblock the PID so that it
|
|
||||||
* runs again
|
|
||||||
*/
|
|
||||||
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc) {
|
|
||||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
|
||||||
if (hadc == &hadc1) {
|
|
||||||
if (pidTaskNotification) {
|
|
||||||
vTaskNotifyGiveFromISR(pidTaskNotification,
|
|
||||||
&xHigherPriorityTaskWoken);
|
|
||||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
|
||||||
FRToSI2C::CpltCallback();
|
|
||||||
}
|
|
||||||
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
|
||||||
FRToSI2C::CpltCallback();
|
|
||||||
}
|
|
||||||
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
|
||||||
FRToSI2C::CpltCallback();
|
|
||||||
}
|
|
||||||
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c __unused) {
|
|
||||||
|
|
||||||
FRToSI2C::CpltCallback();
|
|
||||||
}
|
|
||||||
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
|
||||||
|
|
||||||
FRToSI2C::CpltCallback();
|
|
||||||
}
|
|
||||||
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
|
||||||
FRToSI2C::CpltCallback();
|
|
||||||
}
|
|
||||||
void reboot() {
|
void reboot() {
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
}
|
}
|
||||||
|
|||||||
43
workspace/TS100/Core/BSP/Miniware/IRQ.cpp
Normal file
43
workspace/TS100/Core/BSP/Miniware/IRQ.cpp
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* IRQ.c
|
||||||
|
*
|
||||||
|
* Created on: 30 May 2020
|
||||||
|
* Author: Ralim
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "IRQ.h"
|
||||||
|
/*
|
||||||
|
* Catch the IRQ that says that the conversion is done on the temperature
|
||||||
|
* readings coming in Once these have come in we can unblock the PID so that it
|
||||||
|
* runs again
|
||||||
|
*/
|
||||||
|
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc) {
|
||||||
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
if (hadc == &hadc1) {
|
||||||
|
if (pidTaskNotification) {
|
||||||
|
vTaskNotifyGiveFromISR(pidTaskNotification,
|
||||||
|
&xHigherPriorityTaskWoken);
|
||||||
|
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
||||||
|
FRToSI2C::CpltCallback();
|
||||||
|
}
|
||||||
|
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
||||||
|
FRToSI2C::CpltCallback();
|
||||||
|
}
|
||||||
|
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
||||||
|
FRToSI2C::CpltCallback();
|
||||||
|
}
|
||||||
|
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c __unused) {
|
||||||
|
|
||||||
|
FRToSI2C::CpltCallback();
|
||||||
|
}
|
||||||
|
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
||||||
|
|
||||||
|
FRToSI2C::CpltCallback();
|
||||||
|
}
|
||||||
|
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
||||||
|
FRToSI2C::CpltCallback();
|
||||||
|
}
|
||||||
31
workspace/TS100/Core/BSP/Miniware/IRQ.h
Normal file
31
workspace/TS100/Core/BSP/Miniware/IRQ.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Irqs.h
|
||||||
|
*
|
||||||
|
* Created on: 30 May 2020
|
||||||
|
* Author: Ralim
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BSP_MINIWARE_IRQ_H_
|
||||||
|
#define BSP_MINIWARE_IRQ_H_
|
||||||
|
|
||||||
|
#include "BSP.h"
|
||||||
|
#include "stm32f1xx_hal.h"
|
||||||
|
#include "I2C_Wrapper.hpp"
|
||||||
|
#include "Setup.h"
|
||||||
|
#include "main.hpp"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc);
|
||||||
|
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
|
||||||
|
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||||
|
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||||
|
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||||
|
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||||
|
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* BSP_MINIWARE_IRQ_H_ */
|
||||||
@@ -11,13 +11,6 @@ extern bool settingsWereReset;
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc);
|
|
||||||
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
|
|
||||||
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
|
|
||||||
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
|
||||||
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
|
||||||
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
|
||||||
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
|
||||||
void vApplicationStackOverflowHook(xTaskHandle *pxTask,
|
void vApplicationStackOverflowHook(xTaskHandle *pxTask,
|
||||||
signed portCHAR *pcTaskName);
|
signed portCHAR *pcTaskName);
|
||||||
|
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ int main(void) {
|
|||||||
preRToSInit();
|
preRToSInit();
|
||||||
|
|
||||||
setTipX10Watts(0); // force tip off
|
setTipX10Watts(0); // force tip off
|
||||||
|
resetWatchdog();
|
||||||
OLED::initialize(); // start up the LCD
|
OLED::initialize(); // start up the LCD
|
||||||
OLED::setFont(0); // default to bigger font
|
OLED::setFont(0); // default to bigger font
|
||||||
// Testing for which accelerometer is mounted
|
// Testing for which accelerometer is mounted
|
||||||
resetWatchdog();
|
resetWatchdog();
|
||||||
resetWatchdog();
|
|
||||||
settingsWereReset = restoreSettings(); // load the settings from flash
|
settingsWereReset = restoreSettings(); // load the settings from flash
|
||||||
if (MMA8652FC::detect()) {
|
if (MMA8652FC::detect()) {
|
||||||
PCBVersion = 1;
|
PCBVersion = 1;
|
||||||
@@ -72,11 +72,11 @@ int main(void) {
|
|||||||
PIDTaskStackSize, PIDTaskBuffer, &PIDTaskControlBlock);
|
PIDTaskStackSize, PIDTaskBuffer, &PIDTaskControlBlock);
|
||||||
PIDTaskHandle = osThreadCreate(osThread(PIDTask), NULL);
|
PIDTaskHandle = osThreadCreate(osThread(PIDTask), NULL);
|
||||||
|
|
||||||
if (PCBVersion < 3) {
|
osThreadStaticDef(MOVTask, startMOVTask, osPriorityNormal, 0,
|
||||||
osThreadStaticDef(MOVTask, startMOVTask, osPriorityNormal, 0,
|
MOVTaskStackSize, MOVTaskBuffer, &MOVTaskControlBlock);
|
||||||
MOVTaskStackSize, MOVTaskBuffer, &MOVTaskControlBlock);
|
MOVTaskHandle = osThreadCreate(osThread(MOVTask), NULL);
|
||||||
MOVTaskHandle = osThreadCreate(osThread(MOVTask), NULL);
|
|
||||||
}
|
resetWatchdog();
|
||||||
|
|
||||||
/* Start scheduler */
|
/* Start scheduler */
|
||||||
osKernelStart();
|
osKernelStart();
|
||||||
|
|||||||
Reference in New Issue
Block a user