Test program to fill up the heap

Dependencies:   mbed

Fork of BLE_BatteryLevel by Bluetooth Low Energy

Revision:
16:abab51f6db64
Parent:
15:60e095fe4b45
--- a/main.cpp	Tue Dec 16 09:12:25 2014 +0000
+++ b/main.cpp	Tue Jan 13 07:32:48 2015 +0000
@@ -15,53 +15,13 @@
  */
 
 #include "mbed.h"
-#include "BLEDevice.h"
-#include "BatteryService.h"
 
-BLEDevice  ble;
-
-DigitalOut led1(LED1, 1);
-Ticker t;
-
-void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason)
-{
-    printf("Disconnected handle %u!\n\r", handle);
-    printf("Restarting the advertising process\n\r");
-    ble.startAdvertising();
-}
-
-void blink(void)
-{
-    led1 = !led1;
-}
+volatile uint8_t* heap_tester;
 
 int main(void)
 {
-    uint8_t batteryLevel = 50;
-    t.attach(blink, 1.0f);
-
-    printf("Initialising the nRF51822\n\r");
-
-    ble.init();
-    ble.onDisconnection(disconnectionCallback);
-
-    BatteryService batteryService(ble, batteryLevel);
-
-    /* setup advertising */
-    ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
-    ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
-    ble.setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(1000)); /* 1000ms; in multiples of 0.625ms. */
-    ble.startAdvertising();
-
-    while (true) {
-        ble.waitForEvent(); // this will return upon any system event (such as an interrupt or a ticker wakeup)
-
-        // the magic battery processing
-        batteryLevel++;
-        if (batteryLevel > 100) {
-            batteryLevel = 20;
-        }
-
-        batteryService.updateBatteryLevel(batteryLevel);
-    }
-}
+ while(true)
+ {
+   heap_tester = new uint8_t;
+ }
+}
\ No newline at end of file