static void* GnssUartReadThread(void *context) 15 { 16 int count=0; 17 system("/bin/echo 32 > /sys/class/gpio/export "); 18 system("/bin/echo out > /sys/class/gpio/gpio32/direction"); 19 system("/bin/echo 25 > /sys/class/gpio/export "); 20 system("/bin/echo out > /sys/class/gpio/gpio25/direction"); 21 system("/bin/echo 0 > /sys/class/gpio/gpio25/value"); 22 while(1) 23 { 24 // system("/bin/cat /sys/kernel/debug/wakeup_sources | awk '{print $6 \"\\t\" $1 }' | grep -v \"^0\"^C"); 25 system("/bin/echo 0 > /sys/class/gpio/gpio32/value"); 26 sleep(1); 27 LE_INFO("DEVICE IS RUNNING %ld count:%d ", time(NULL) , count++); 28 system("/bin/echo 1 > /sys/class/gpio/gpio32/value"); 29 sleep(1); 30 } 31 32 le_event_RunLoop(); 33 } 34 35 36 static void CreateGnssReadThread(void) 37 { 38 LE_INFO("CreateGnssReadThread entry"); 39 le_thread_Ref_t GnssThreadref = le_thread_Create("Gnsread", GnssUartReadThread, NULL); 40 41 LE_ASSERT(le_thread_SetPriority(GnssThreadref, LE_THREAD_PRIORITY_IDLE) == LE_OK); 42 43 le_thread_Start(GnssThreadref); 44 LE_INFO("CreateGnssReadThread exit"); 45 } 46 // This function is called only once on startup. Place your initialization and event registration 47 // here. 48 COMPONENT_INIT 49 { 50 // Write in the log that this component has started. 51 LE_INFO("This sample app simulates GPIO based wakeup for device in selective suspend\n"); 52 CreateGnssReadThread(); 53 54 return; }