Skip to content

Commit

Permalink
Merge #17830 #19635
Browse files Browse the repository at this point in the history
17830: periph/timer: fix Kconfig menu title r=aabadie a=gschorcht

### Contribution description

This PR is a very small fix of inconsistent peripheral driver entry in `Kconfig` for `periph/timer`.

In Kconfig menu `(Top) → Drivers → Peripherals drivers` all entries start with the peripheral name in alphabetical order with only one exception, the timer entry. This entry is called `Configure timer peripheral driver`:
```
[ ] CPU unique ID
[ ] EEPROM peripheral driver
[ ] Flashpage peripheral driver  ----
[*] GPIO peripheral driver  --->
[ ] HWRNG peripheral driver
[ ] PWM peripheral driver
[*] Power Management (PM) peripheral driver
[*]     Auto initialize Power Management (PM) peripheral
[ ] Quadrature Decoder (QDEC) peripheral driver
[ ] RTC peripheral driver  ----
[ ] SPI peripheral driver  ----
[*] UART peripheral driver  --->
[*] Configure timer peripheral driver  --->
```
This is confusing and doesn't help to find the right entry. This PR
1. changes the entry to `Timer peripheral driver` and
2. corrects the alphabetical order.

### Testing procedure

Use command
```
TEST_KCONFIG=1 make -C tests/periph_timer menuconfig
```
and check the output. in menu `(Top) → Drivers → Peripherals drivers`. It should be with this PR:
```
[ ] CPU unique ID
[ ] EEPROM peripheral driver
[ ] Flashpage peripheral driver  ----
[*] GPIO peripheral driver  --->
[ ] HWRNG peripheral driver
[ ] PWM peripheral driver
[*] Power Management (PM) peripheral driver
[*]     Auto initialize Power Management (PM) peripheral
[ ] Quadrature Decoder (QDEC) peripheral driver
[ ] RTC peripheral driver  ----
[ ] SPI peripheral driver  ----
[*] Timer peripheral driver  --->
[*] UART peripheral driver  --->
```
### Issues/PRs references


19635: drivers/mrf24j40: cleanup function r=aabadie a=maribu

### Contribution description

`_set_csma_params()` spends some time to prepare a value in `uint8_t tmp`, which then is never used. Likely this is a leftover of moving code to `mrf24j40_set_csma_max_retries()`. This drops the leftover code.


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
  • Loading branch information
3 people authored May 20, 2023
3 parents 7ac0b6f + 4bdcc93 + c10b883 commit 8fc1187
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
7 changes: 0 additions & 7 deletions drivers/mrf24j40/mrf24j40_radio_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,12 @@ static int _config_phy(ieee802154_dev_t *hal, const ieee802154_phy_conf_t *conf)
static int _set_csma_params(ieee802154_dev_t *hal, const ieee802154_csma_be_t *bd, int8_t retries)
{
mrf24j40_t *dev = hal->priv;
uint8_t tmp;

if (bd->min > MRF24J40_MAX_MINBE) {
return -EINVAL;
}

tmp = mrf24j40_reg_read_short(dev, MRF24J40_REG_TXMCR) & ~MRF24J40_TXMCR_MACMINBE;
if (retries >= 0) {
tmp |= bd->min << MRF24J40_TXMCR_MACMINBE_SHIFT;
}

/* This radio ignores max_be */

mrf24j40_set_csma_max_retries(dev, retries);
return 0;
}
Expand Down
22 changes: 11 additions & 11 deletions drivers/periph_common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,6 @@ config MODULE_PERIPH_INIT_HWRNG

rsource "Kconfig.i2c"

config MODULE_PERIPH_PWM
bool "PWM peripheral driver"
depends on HAS_PERIPH_PWM
select MODULE_PERIPH_COMMON

config MODULE_PERIPH_INIT_PWM
bool "Auto initialize PWM peripheral"
default y if MODULE_PERIPH_INIT
depends on MODULE_PERIPH_PWM

config MODULE_PERIPH_PM
bool "Power Management (PM) peripheral driver"
default y
Expand All @@ -111,6 +101,16 @@ config MODULE_PERIPH_INIT_PM
default y if MODULE_PERIPH_INIT
depends on MODULE_PERIPH_PM

config MODULE_PERIPH_PWM
bool "PWM peripheral driver"
depends on HAS_PERIPH_PWM
select MODULE_PERIPH_COMMON

config MODULE_PERIPH_INIT_PWM
bool "Auto initialize PWM peripheral"
default y if MODULE_PERIPH_INIT
depends on MODULE_PERIPH_PWM

config MODULE_PERIPH_QDEC
bool "Quadrature Decoder (QDEC) peripheral driver"
depends on HAS_PERIPH_QDEC
Expand Down Expand Up @@ -155,6 +155,7 @@ config MODULE_PERIPH_INIT_TEMPERATURE
default y if MODULE_PERIPH_INIT
depends on MODULE_PERIPH_TEMPERATURE

rsource "Kconfig.timer"
rsource "Kconfig.uart"
rsource "Kconfig.usbdev"

Expand All @@ -166,6 +167,5 @@ config HAVE_SHARED_PERIPH_RTT_PERIPH_RTC
The periph_rtc module or the periph_rtt module share hardware, thus,
only one can be selected.

rsource "Kconfig.timer"
rsource "Kconfig.vbat"
rsource "Kconfig.wdt"
2 changes: 1 addition & 1 deletion drivers/periph_common/Kconfig.timer
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if TEST_KCONFIG

menuconfig MODULE_PERIPH_TIMER
bool "Configure timer peripheral driver"
bool "Timer peripheral driver"
depends on HAS_PERIPH_TIMER
select MODULE_PERIPH_COMMON

Expand Down

0 comments on commit 8fc1187

Please sign in to comment.