Sleep doesn't work the same in debug as it does in real time. Please post you code so we can check it.
Sorry about the messy code, I've been trying to get proof-of-concept working and hav'nt bothered to clean up the architecture/code much.
I figured it might be something with the power modes, but I can't see how.
What voltage is your battery? The settings for your ADC are set for 0 to 1.024 Volts that is very low for a battery for this Chip. Also your pin selection is not correct for the ADC input. I moved it to P3(4) from P5(0). I haven't tried it on my board yet. It doesn't like this line in your BleStack.c uint8 buttons = ButtonStatus(); Says trying to make a integer from a pointer without a cast.
The battery is a lithium coin cell, so it will run between 2.8 and 3.3 volts. I have an external resistor-divider network attached between pins 5.0 and 5.1 from the battery voltage. I've been using it to measure the battery voltage of the coin cell with reference to the internal 1.024v, as reading the ADC value of the Vdd itself will always give maximum "count" until the battery dies as the voltage reference will vary itself with the reading. I'm using the ADC on P5.0 and pulling pin5.1 low while I read the voltage of the battery with reference to the internal 1.024v and then putting it back to high/analog-impedance once I am done reading to remove as much leakage current as possible.
You can just comment out the uint8 buttons = ButtonStatus(); line, as it is currently unreachable in the code. I have it set up to use a different BLE callback function based on which mode the unit is in in order to simplify the code flow and logic, but since I can't get the power-saving operations working I disabled the "Normal_BLE" and "Bonding_BLE" callbacks and set it to permanently use the "Broadcast_BLE" callback.
At using p5.0 for the adc, reading the popup it says only that it might cause routing congestion/failure if I use that pin for the ADC, but it seems to work fine when testing the hardware and based on the compiler/IDE output when building and programming it.