IRQ int
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#define SDA_LOW() HAL_GPIO_WritePin(SDA2_GPIO_Port, SDA2_Pin, GPIO_PIN_RESET)
|
||||
#define SDA_READ() (HAL_GPIO_ReadPin(SDA2_GPIO_Port,SDA2_Pin)==GPIO_PIN_SET?1:0)
|
||||
#define SCL_READ() (HAL_GPIO_ReadPin(SCL2_GPIO_Port,SCL2_Pin)==GPIO_PIN_SET?1:0)
|
||||
#define I2C_DELAY() {for(int xx=0;xx<700;xx++){asm("nop");}}
|
||||
#define I2C_DELAY() {for(int xx=0;xx<100;xx++){asm("nop");}}
|
||||
SemaphoreHandle_t I2CBB::I2CSemaphore = NULL;
|
||||
StaticSemaphore_t I2CBB::xSemaphoreBuffer;
|
||||
void I2CBB::init() {
|
||||
@@ -269,7 +269,11 @@ bool I2CBB::lock() {
|
||||
if (I2CSemaphore == NULL) {
|
||||
asm("bkpt");
|
||||
}
|
||||
return xSemaphoreTake(I2CSemaphore, (TickType_t) 50) == pdTRUE;
|
||||
bool a = xSemaphoreTake(I2CSemaphore, (TickType_t) 50) == pdTRUE;
|
||||
if (!a) {
|
||||
asm("bkpt");
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
void I2CBB::write_bit(uint8_t val) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "IRQ.h"
|
||||
#include "int_n.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
|
||||
@@ -41,3 +42,7 @@ void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
||||
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
|
||||
FRToSI2C::CpltCallback();
|
||||
}
|
||||
|
||||
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
||||
InterruptHandler::irqCallback();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ 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 HAL_GPIO_EXTI_Callback(uint16_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user