Hello!
I started learning programming contiki os, using sensortag. So now i trying to make cc2650 sleep in standby mode.
I found this module for lpm - https://github.com/contiki-os/contiki/blob/master/cpu/cc26xx-cc13xx/lpm.h
But i dont understand how to use it.
I need to be in standby mode all time, exept when reed relay sensor have impulse.
I wrote a simple code:
PROCESS_THREAD(blink_example, ev, data)
{
PROCESS_BEGIN();
lpm_init();
while(1) {
PROCESS_WAIT_EVENT_UNTIL(ev == sensors_event &&
(data == &button_sensor || data == &reed_relay_sensor));
if (data == &reed_relay_sensor){
//here i want to wakeup
GetImpulse();
lpm_drop();
//after execute GetImpulse function i want to go to Satndby mode. How can i do it?
}
}
PROCESS_END();
}
In this example sensortag doing nothing. But if a delete lpm_init(); and lpm_drop(); - GetImpulse() is working (Leds on and off). So do ypu have any example how to use lpm for sensortag or just cc2650.
Thank you!