Install a hardfault handler on NRF52

This commit is contained in:
geeksville
2020-07-15 13:24:57 -07:00
parent 4147786b12
commit f919eb6a64
3 changed files with 36 additions and 81 deletions

View File

@@ -216,58 +216,4 @@ void NRF52Bluetooth::setup()
void updateBatteryLevel(uint8_t level)
{
blebas.write(level);
}
/*
void loop()
{
digitalToggle(LED_RED);
if ( Bluefruit.connected() ) {
uint8_t hrmdata[2] = { 0b00000110, bps++ }; // Sensor connected, increment BPS value
// Note: We use .notify instead of .write!
// If it is connected but CCCD is not enabled
// The characteristic's value is still updated although notification is not sent
if ( hrmc.notify(hrmdata, sizeof(hrmdata)) ){
Serial.print("Heart Rate Measurement updated to: "); Serial.println(bps);
}else{
Serial.println("ERROR: Notify not set in the CCCD or not connected!");
}
}
// Only send update once per second
delay(1000);
}
*/
/*
examples of advanced characteristics. use setReadAuthorizeCallback to prepare data for reads by others
err_t BLEDfu::begin(void)
{
// Invoke base class begin()
VERIFY_STATUS( BLEService::begin() );
// No need to keep packet & revision characteristics
BLECharacteristic chr_packet(UUID128_CHR_DFU_PACKET);
chr_packet.setTempMemory();
chr_packet.setProperties(CHR_PROPS_WRITE_WO_RESP);
chr_packet.setMaxLen(20);
VERIFY_STATUS( chr_packet.begin() );
_chr_control.setProperties(CHR_PROPS_WRITE | CHR_PROPS_NOTIFY);
_chr_control.setMaxLen(23);
_chr_control.setWriteAuthorizeCallback(bledfu_control_wr_authorize_cb);
VERIFY_STATUS( _chr_control.begin() );
BLECharacteristic chr_revision(UUID128_CHR_DFU_REVISON);
chr_revision.setTempMemory();
chr_revision.setProperties(CHR_PROPS_READ);
chr_revision.setFixedLen(2);
VERIFY_STATUS( chr_revision.begin());
chr_revision.write16(DFU_REV_APPMODE);
return ERROR_NONE;
}
*/
}