Fixing signal strength (#2474)
This commit is contained in:
parent
b2a43b50b5
commit
05bf2eec2a
@ -6,7 +6,6 @@ using namespace pxt;
|
|||||||
namespace radio {
|
namespace radio {
|
||||||
|
|
||||||
bool radioEnabled = false;
|
bool radioEnabled = false;
|
||||||
PacketBuffer packet;
|
|
||||||
|
|
||||||
int radioEnable() {
|
int radioEnable() {
|
||||||
int r = uBit.radio.enable();
|
int r = uBit.radio.enable();
|
||||||
@ -81,8 +80,8 @@ namespace radio {
|
|||||||
//% blockId=radio_datagram_rssi block="radio received signal strength"
|
//% blockId=radio_datagram_rssi block="radio received signal strength"
|
||||||
//% deprecated=true
|
//% deprecated=true
|
||||||
int receivedSignalStrength() {
|
int receivedSignalStrength() {
|
||||||
if (radioEnable() != MICROBIT_OK || packet == NULL) return 0;
|
if (radioEnable() != MICROBIT_OK) return 0;
|
||||||
return packet.getRSSI();
|
return uBit.radio.getRSSI();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user