💾 Archived View for gmi.noulin.net › gitRepositories › signalTimer › file › test.c.gmi captured on 2023-01-29 at 13:18:05. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
test.c (643B)
1 #! /usr/bin/env sheepy 2 /* or direct path to sheepy: #! /usr/local/bin/sheepy */ 3 4 #include "libsheepyObject.h" 5 #include "signalTimer.h" 6 7 int argc; char **argv; 8 9 void callback(void *args) { 10 logI("timer callback"); 11 } 12 13 int main(int ARGC, char** ARGV) { 14 15 argc = ARGC; argv = ARGV; 16 17 initLibsheepy(argv[0]); 18 19 puts("C template"); 20 21 createAllocateSignalTimer(sT); 22 sT->f->start(sT, 500, callback, NULL); 23 24 i16 c = 0; 25 while(1) { 26 sT->f->pauseProcess(sT); 27 c++; 28 if (c == 4) break; 29 } 30 31 sT->f->pause(sT); 32 nanoSleep(2000000000); 33 34 sT->f->setInterval(sT, 100); 35 36 while(1) { 37 sT->f->pauseProcess(sT); 38 } 39 40 terminateG(sT); 41 }