Skip to content

Commit

Permalink
BLE: Simplify device name string creation.
Browse files Browse the repository at this point in the history
It's a small change that results in the same string,
but it saves about 36 bytes of flash with gcc v10.3
  • Loading branch information
microbit-carlos committed Sep 5, 2023
1 parent 4f2aedc commit 50919f2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions source/bluetooth/MicroBitBLEManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,7 @@ void MicroBitBLEManager::init( ManagedString deviceName, ManagedString serialNum
#if CONFIG_ENABLED(MICROBIT_BLE_DEVICE_INFORMATION_SERVICE)
MICROBIT_DEBUG_DMESG( "DEVICE_INFORMATION_SERVICE");

ManagedString modelVersion("V2");
ManagedString disName( MICROBIT_BLE_MODEL);
disName = disName + " " + modelVersion;

ManagedString disName(MICROBIT_BLE_MODEL + ManagedString(" V2"));
ble_dis_init_t disi;
memset( &disi, 0, sizeof(disi));
disi.dis_char_rd_sec = SEC_OPEN;
Expand Down

0 comments on commit 50919f2

Please sign in to comment.