mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/sx126x : Uncrustify
This commit is contained in:
parent
9a0431637b
commit
29c392d52d
@ -87,7 +87,9 @@ static const uint16_t _bw_khz[3] = {
|
|||||||
|
|
||||||
static uint8_t _compute_ldro(sx126x_t *dev)
|
static uint8_t _compute_ldro(sx126x_t *dev)
|
||||||
{
|
{
|
||||||
uint32_t symbol_len = (uint32_t)(1 << dev->mod_params.sf) / _bw_khz[dev->mod_params.bw - SX126X_LORA_BW_125];
|
uint32_t symbol_len =
|
||||||
|
(uint32_t)(1 << dev->mod_params.sf) / _bw_khz[dev->mod_params.bw - SX126X_LORA_BW_125];
|
||||||
|
|
||||||
if (symbol_len >= 16) {
|
if (symbol_len >= 16) {
|
||||||
return 0x01;
|
return 0x01;
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
|
|
||||||
/* Write payload buffer */
|
/* Write payload buffer */
|
||||||
for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) {
|
for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) {
|
||||||
if (iol->iol_len > 0) {
|
if (iol->iol_len > 0) {
|
||||||
@ -125,6 +126,7 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
|
|||||||
static int _init(netdev_t *netdev)
|
static int _init(netdev_t *netdev)
|
||||||
{
|
{
|
||||||
sx126x_t *dev = (sx126x_t *)netdev;
|
sx126x_t *dev = (sx126x_t *)netdev;
|
||||||
|
|
||||||
if (sx126x_is_stm32wl(dev)) {
|
if (sx126x_is_stm32wl(dev)) {
|
||||||
#if IS_USED(MODULE_SX126X_STM32WL)
|
#if IS_USED(MODULE_SX126X_STM32WL)
|
||||||
_dev = netdev;
|
_dev = netdev;
|
||||||
|
@ -46,15 +46,14 @@
|
|||||||
#if IS_USED(MODULE_SX126X_STM32WL)
|
#if IS_USED(MODULE_SX126X_STM32WL)
|
||||||
static uint8_t sx126x_radio_wait_until_ready(sx126x_t *dev)
|
static uint8_t sx126x_radio_wait_until_ready(sx126x_t *dev)
|
||||||
{
|
{
|
||||||
if (dev->radio_sleep == true)
|
if (dev->radio_sleep == true) {
|
||||||
{
|
DEBUG("[sx126x_radio] : Wakeup radio \n");
|
||||||
DEBUG("[sx126x_radio] : Wakeup radio \n");
|
sx126x_hal_wakeup(dev);
|
||||||
sx126x_hal_wakeup(dev);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Wait until Busy/ BusyMS signal goes low */
|
/* Wait until Busy/ BusyMS signal goes low */
|
||||||
while (((PWR->SR2 & PWR_SR2_RFBUSYMS) && ((PWR->SR2 & PWR_SR2_RFBUSYS))) == 1) {}
|
while (((PWR->SR2 & PWR_SR2_RFBUSYMS) && ((PWR->SR2 & PWR_SR2_RFBUSYS))) == 1) {}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -157,7 +156,7 @@ sx126x_hal_status_t sx126x_hal_reset(const void *context)
|
|||||||
RCC->CSR &= ~RCC_CSR_RFRST;
|
RCC->CSR &= ~RCC_CSR_RFRST;
|
||||||
ztimer_sleep(ZTIMER_USEC, 100);
|
ztimer_sleep(ZTIMER_USEC, 100);
|
||||||
/* Wait while reset is done */
|
/* Wait while reset is done */
|
||||||
while((RCC->CSR & RCC_CSR_RFRSTF) != 0UL) {}
|
while ((RCC->CSR & RCC_CSR_RFRSTF) != 0UL) {}
|
||||||
|
|
||||||
/* Asserts the reset signal of the Radio peripheral */
|
/* Asserts the reset signal of the Radio peripheral */
|
||||||
PWR->SUBGHZSPICR |= PWR_SUBGHZSPICR_NSS;
|
PWR->SUBGHZSPICR |= PWR_SUBGHZSPICR_NSS;
|
||||||
|
Loading…
Reference in New Issue
Block a user