Fixing signal strength (#2474)

This commit is contained in:
Abhijith Chatra 2019-10-15 15:36:25 -07:00 committed by Abhijith
parent b2a43b50b5
commit 05bf2eec2a

View File

@ -6,7 +6,6 @@ using namespace pxt;
namespace radio {
bool radioEnabled = false;
PacketBuffer packet;
int radioEnable() {
int r = uBit.radio.enable();
@ -81,8 +80,8 @@ namespace radio {
//% blockId=radio_datagram_rssi block="radio received signal strength"
//% deprecated=true
int receivedSignalStrength() {
if (radioEnable() != MICROBIT_OK || packet == NULL) return 0;
return packet.getRSSI();
if (radioEnable() != MICROBIT_OK) return 0;
return uBit.radio.getRSSI();
}
/**