Skip to content

Commit

Permalink
radio: Reduce power level options to match V1 DAL. (lancaster-univers…
Browse files Browse the repository at this point in the history
…ity#275)

As discussed in lancaster-university#260

This change more closely matches the input values for `MicroBitRadio::setTransmitPower()` that micro:bit V1 DAL has, so code trying to achieve the max possible value (`uBit.radio.setTransmitPower(7)`) works correctly in both V1 & V2.
  • Loading branch information
microbit-carlos authored Aug 30, 2023
1 parent 5967ea2 commit fbe41c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inc/MicroBitRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ namespace codal
// Default configuration values
#define MICROBIT_RADIO_BASE_ADDRESS 0x75626974
#define MICROBIT_RADIO_DEFAULT_GROUP 0
#define MICROBIT_RADIO_DEFAULT_TX_POWER 7
#define MICROBIT_RADIO_DEFAULT_TX_POWER 6
#define MICROBIT_RADIO_DEFAULT_FREQUENCY 7
#define MICROBIT_RADIO_MAX_PACKET_SIZE 32
#define MICROBIT_RADIO_HEADER_SIZE 4
#define MICROBIT_RADIO_MAXIMUM_RX_BUFFERS 4
#define MICROBIT_RADIO_POWER_LEVELS 10
#define MICROBIT_RADIO_POWER_LEVELS 8

// Known Protocol Numbers
#define MICROBIT_RADIO_PROTOCOL_DATAGRAM 1 // A simple, single frame datagram. a little like UDP but with smaller packets. :-)
Expand Down
2 changes: 1 addition & 1 deletion source/MicroBitRadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DEALINGS IN THE SOFTWARE.

using namespace codal;

const uint8_t MICROBIT_RADIO_POWER_LEVEL[] = {0xD8, 0xD8, 0xEC, 0xF0, 0xF4, 0xF8, 0xFC, 0x00, 0x03, 0x04};
const uint8_t MICROBIT_RADIO_POWER_LEVEL[] = {0xD8, 0xEC, 0xF0, 0xF4, 0xF8, 0xFC, 0x00, 0x04};

/**
* Provides a simple broadcast radio abstraction, built upon the raw nrf51822 RADIO module.
Expand Down

0 comments on commit fbe41c4

Please sign in to comment.