изменила название дефайна про кол-во прерываний. В wiring_private.h подтягиваю дефайн из pins_arduino
This commit is contained in:
1 parent
65d07edece
commit
a8b2cf3b0c
7 files changed
+40
-38
No files matched your search
@@ -111,7 +111,8 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
#define WIRE_FREQ_1000K 1000000
|
||||
|
||||
// interrupts
|
||||
extern uint8_t interruptInfo[EXTERNAL_NUM_INTERRUPTS][3];
|
||||
#define EXTERNAL_INTERRUPTS_QTY 7
|
||||
extern uint8_t interruptInfo[EXTERNAL_INTERRUPTS_QTY][3];
|
||||
// determines the board pin number by interrupt number
|
||||
#define interruptToDigitalPin(interruptNum) (interruptInfo[interruptNum][0])
|
||||
// determines gpio interrupt line by interrupt number
|
||||
|
||||
@@ -224,7 +224,7 @@ HAL_TIMER32_CHANNEL_IndexTypeDef pwmPinToTimerChannel(uint32_t digPinNumber)
|
||||
// ---------------------- interrupts ---------------------- //
|
||||
// interrupt table is stored in ram to improve performance
|
||||
// index = interrupt number. In each row {digitalPinNumber, IntLineValue, IntMuxValue}
|
||||
uint8_t interruptInfo[EXTERNAL_NUM_INTERRUPTS][3] =
|
||||
uint8_t interruptInfo[EXTERNAL_INTERRUPTS_QTY][3] =
|
||||
{
|
||||
{ 2, GPIO_LINE_2, GPIO_MUX_LINE_2_PORT0_10}, // INT0
|
||||
{ 3, GPIO_LINE_0, GPIO_MUX_LINE_0_PORT0_0}, // INT1
|
||||
@@ -237,7 +237,7 @@ uint8_t interruptInfo[EXTERNAL_NUM_INTERRUPTS][3] =
|
||||
|
||||
int8_t digitalPinToGpioIntMux(uint8_t digPinNumber)
|
||||
{
|
||||
for (uint8_t i = 0; i < EXTERNAL_NUM_INTERRUPTS; i++)
|
||||
for (uint8_t i = 0; i < EXTERNAL_INTERRUPTS_QTY; i++)
|
||||
{
|
||||
if (interruptInfo[i][0] == digPinNumber)
|
||||
return interruptInfo[i][2];
|
||||
@@ -246,7 +246,7 @@ int8_t digitalPinToGpioIntMux(uint8_t digPinNumber)
|
||||
}
|
||||
int8_t digitalPinToGpioIntLine(uint8_t digPinNumber)
|
||||
{
|
||||
for (uint8_t i = 0; i < EXTERNAL_NUM_INTERRUPTS; i++)
|
||||
for (uint8_t i = 0; i < EXTERNAL_INTERRUPTS_QTY; i++)
|
||||
{
|
||||
if (interruptInfo[i][0] == digPinNumber)
|
||||
return interruptInfo[i][1];
|
||||
@@ -256,7 +256,7 @@ int8_t digitalPinToGpioIntLine(uint8_t digPinNumber)
|
||||
|
||||
int8_t gpioIntLineToInterrupt(uint32_t gpioIntLine)
|
||||
{
|
||||
for (uint8_t i = 0; i < EXTERNAL_NUM_INTERRUPTS; i++)
|
||||
for (uint8_t i = 0; i < EXTERNAL_INTERRUPTS_QTY; i++)
|
||||
{
|
||||
if (interruptInfo[i][1] == gpioIntLine)
|
||||
return i;
|
||||
@@ -266,7 +266,7 @@ int8_t gpioIntLineToInterrupt(uint32_t gpioIntLine)
|
||||
|
||||
int8_t digitalPinToInterrupt(uint32_t digPinNumber)
|
||||
{
|
||||
for (uint8_t i = 0; i < EXTERNAL_NUM_INTERRUPTS; i++)
|
||||
for (uint8_t i = 0; i < EXTERNAL_INTERRUPTS_QTY; i++)
|
||||
{
|
||||
if (interruptInfo[i][0] == digPinNumber)
|
||||
return i;
|
||||
|
||||
Reference in new issue
Block a user