Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpu/cc2538/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
GPIO_IN_PD = ((uint8_t)OVERRIDE_PULLDOWN), /**< input, pull-down */
GPIO_IN_PU = ((uint8_t)OVERRIDE_PULLUP), /**< input, pull-up */
GPIO_OUT = ((uint8_t)OVERRIDE_ENABLE), /**< output */
GPIO_OD = (0xff), /**< not supported */
GPIO_OD = (0xfe), /**< not supported */
GPIO_OD_PU = (0xff) /**< not supported */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it wouldn't be more logical to change the value for GPIO_OD instead of GPIO_OD_PU to 0xfe to have the values in ascending order, as an enumeration normally does.

Copy link
Contributor Author

@crasbe crasbe May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Edit: from a compiler or program standpoint, it shouldn't make a difference anyway, but I'm all for style too :)

} gpio_mode_t;
/** @} */
Expand Down Expand Up @@ -341,9 +341,9 @@
* @{
*/
#define SOC_ADC_ADCCON3_EREF_INT (0 << SOC_ADC_ADCCON3_EREF_S) /**< Internal reference */
#define SOC_ADC_ADCCON3_EREF_EXT (1 << SOC_ADC_ADCCON3_EREF_S) /**< External reference on AIN7 pin */

Check warning on line 344 in cpu/cc2538/include/periph_cpu.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#define SOC_ADC_ADCCON3_EREF_AVDD5 (2 << SOC_ADC_ADCCON3_EREF_S) /**< AVDD5 pin */
#define SOC_ADC_ADCCON3_EREF_DIFF (3 << SOC_ADC_ADCCON3_EREF_S) /**< External reference on AIN6-AIN7 differential input */

Check warning on line 346 in cpu/cc2538/include/periph_cpu.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
/** @} */

/**
Expand Down
4 changes: 2 additions & 2 deletions cpu/cc2538/periph/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define ENABLE_DEBUG 0
#include "debug.h"

#define MODE_NOTSUP (0xff)
#define MODE_NOTSUP (0xf0)

#ifdef MODULE_PERIPH_GPIO_IRQ
static gpio_isr_ctx_t isr_ctx[4][8];
Expand Down Expand Up @@ -100,7 +100,7 @@
int gpio_init(gpio_t pin, gpio_mode_t mode)
{
/* check if mode is valid */
if (mode == MODE_NOTSUP) {
if (mode >= MODE_NOTSUP) {
return -1;
}

Expand Down Expand Up @@ -169,7 +169,7 @@

/* configure the active flank(s) */
gpio(pin)->IS &= ~_pin_mask(pin);
switch(flank) {

Check warning on line 172 in cpu/cc2538/periph/gpio.c

View workflow job for this annotation

GitHub Actions / static-tests

keyword 'switch' not followed by a single space
case GPIO_FALLING:
gpio(pin)->IBE &= ~_pin_mask(pin);
gpio(pin)->IEV &= ~_pin_mask(pin);
Expand Down