minimizing power on C027
Dependencies: C027_Support mbed
Fork of PowerControl by
Diff: main.cpp
- Revision:
- 1:21401fc44382
- Parent:
- 0:9bd5f1bdb845
diff -r 9bd5f1bdb845 -r 21401fc44382 main.cpp --- a/main.cpp Sat Jan 30 02:23:30 2010 +0000 +++ b/main.cpp Wed May 27 05:59:21 2015 +0000 @@ -1,15 +1,35 @@ #include "mbed.h" #include "PowerControl/PowerControl.h" #include "PowerControl/EthernetPowerControl.h" +#include "MDM.h" +#include "GPS.h" + +DigitalOut led(LED); +void hello() { + led = !led; +} int main() { - //turn OSC1 down - PHY_PowerDown(); - wait(5); - LPC_GPIO1->FIODIR = 0x8000000; - LPC_GPIO1->FIOCLR = 0x8000000; - wait(5); - LPC_GPIO1->FIOSET = 0x8000000; - wait(5); - PHY_PowerUp(); + printf("Starting\r\n"); + wait(5); + printf("Modem on\r\n"); + MDMSerial mdm; + wait(5); + printf("GPS on\r\n"); + GPSI2C gps; + wait(5); + printf("PHY off\r\n"); + PHY_PowerDown(); + wait(5); + printf("Modem off\r\n"); + mdm.powerOff(); + wait(5); + printf("GPS off\r\n"); + gps.powerOff(); + printf("Sleeping\r\n"); + Timeout t; + t.attach(&hello, 5.0f); + Sleep(); + printf("Woke up\r\n"); + while (true); } \ No newline at end of file