Skip to content

Commit

Permalink
Use UartDividerRatio in impl
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmuskleist committed Aug 7, 2023
1 parent edb60ce commit 9889b0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/modm/driver/radio/sx128x.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class Sx128x : public sx128x, public Transport
/// @warning UART only
/// @attention UART communication must be initiated with 115.2 kbps
modm::ResumableResult<bool>
setUartSpeed(uint16_t uartDividerRatio);
setUartSpeed(UartDividerRatio uartDividerRatio);

/// Set the role of the radio in ranging operation
modm::ResumableResult<bool>
Expand Down
6 changes: 3 additions & 3 deletions src/modm/driver/radio/sx128x_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,12 @@ Sx128x< Transport, Reset, Busy >::setLongPreamble(bool enable)

template < class Transport, class Reset, class Busy >
modm::ResumableResult<bool>
Sx128x< Transport, Reset, Busy >::setUartSpeed(uint16_t uartDividerRatio)
Sx128x< Transport, Reset, Busy >::setUartSpeed(UartDividerRatio uartDividerRatio)
{
RF_BEGIN();

buffer[0] = (uartDividerRatio >> 8) & 0xFF;
buffer[1] = uartDividerRatio & 0xFF;
buffer[0] = (i(uartDividerRatio) >> 8) & 0xFF;
buffer[1] = i(uartDividerRatio) & 0xFF;
RF_WAIT_WHILE(isBusy());

RF_END_RETURN_CALL(this->writeCommand(Opcode::SetLongPreamble, std::span{buffer, 1}));
Expand Down

0 comments on commit 9889b0b

Please sign in to comment.