Skip to content

Commit

Permalink
pins should be uint16_t
Browse files Browse the repository at this point in the history
  • Loading branch information
joeycastillo committed Jul 16, 2024
1 parent 0676695 commit 29c3ecf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions peripherals/eic.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void eic_enable(void) {
#endif
}

int8_t eic_configure_pin(const uint32_t pin, eic_interrupt_trigger trigger) {
int8_t eic_configure_pin(const uint16_t pin, eic_interrupt_trigger trigger) {
uint16_t port = pin >> 8;
int8_t channel = _eic_pin_to_channel[port][pin % 32];
if (channel < 0) {
Expand Down Expand Up @@ -125,7 +125,7 @@ int8_t eic_configure_pin(const uint32_t pin, eic_interrupt_trigger trigger) {
return channel;
}

bool eic_enable_interrupt(const uint8_t pin) {
bool eic_enable_interrupt(const uint16_t pin) {
int8_t channel = _eic_pin_to_channel[pin / 32][pin % 32];
if (channel < 0) {
return false;
Expand All @@ -146,7 +146,7 @@ bool eic_enable_interrupt(const uint8_t pin) {
return true;
}

bool eic_disable_interrupt(const uint8_t pin) {
bool eic_disable_interrupt(const uint16_t pin) {
int8_t channel = _eic_pin_to_channel[pin / 32][pin % 32];
if (channel < 0) {
return false;
Expand All @@ -167,7 +167,7 @@ bool eic_disable_interrupt(const uint8_t pin) {
return true;
}

bool eic_enable_event(const uint8_t pin) {
bool eic_enable_event(const uint16_t pin) {
int8_t channel = _eic_pin_to_channel[pin / 32][pin % 32];
if (channel < 0) {
return false;
Expand All @@ -186,7 +186,7 @@ bool eic_enable_event(const uint8_t pin) {
return true;
}

bool eic_disable_event(const uint8_t pin) {
bool eic_disable_event(const uint16_t pin) {
int8_t channel = _eic_pin_to_channel[pin / 32][pin % 32];
if (channel < 0) {
return false;
Expand Down
10 changes: 5 additions & 5 deletions peripherals/eic.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,27 @@ void eic_enable(void);
* @note Be sure to check your pin multiplexing table to ensure that you do not have multiple pins
* assigned to the same interrupt channel. Also note that the NMI pin is not currently supported.
*/
int8_t eic_configure_pin(const uint32_t pin, eic_interrupt_trigger trigger);
int8_t eic_configure_pin(const uint16_t pin, eic_interrupt_trigger trigger);

/** @brief Enables an interrupt on the given interrupt channel.
* @param pin The external interrupt pin.
*/
bool eic_enable_interrupt(const uint8_t pin);
bool eic_enable_interrupt(const uint16_t pin);

/** @brief Disables the interrupt on the given interrupt channel.
* @param pin The external interrupt pin.
*/
bool eic_disable_interrupt(const uint8_t pin);
bool eic_disable_interrupt(const uint16_t pin);

/** @brief Enables an interrupt on the given interrupt channel.
* @param pin The external interrupt pin.
*/
bool eic_enable_event(const uint8_t pin);
bool eic_enable_event(const uint16_t pin);

/** @brief Disables the interrupt on the given interrupt channel.
* @param pin The external interrupt pin.
*/
bool eic_disable_event(const uint8_t pin);
bool eic_disable_event(const uint16_t pin);

/** @brief Configures an external interrupt callback.
* @details You only get the one callback, so if you need to handle multiple interrupts, you'll need
Expand Down

0 comments on commit 29c3ecf

Please sign in to comment.