tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit 61c9b27091a4362fc02e491b743571c8efdee7e4
parent a641a83c730c8dd962dee6569393878a242061f9
Author: rbckman <robinbackman@gmail.com>
Date:   Sat, 21 Jan 2017 21:20:23 +0000

only render menu when stuff happens

Diffstat:
Mvc/src/hello_pi/hello_interface/camerainterface.bin | 0
Mvc/src/hello_pi/hello_interface/main.c | 13++++++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/vc/src/hello_pi/hello_interface/camerainterface.bin b/vc/src/hello_pi/hello_interface/camerainterface.bin Binary files differ. diff --git a/vc/src/hello_pi/hello_interface/main.c b/vc/src/hello_pi/hello_interface/main.c @@ -137,6 +137,9 @@ int main(void) int len_string_more5; int len_string_more6; int count = 120; + int sleeptime = 100000; + char check[500]; + char oldcheck[500]; char seleold; char text[80]; char text2[4]; @@ -174,6 +177,11 @@ int main(void) fclose(fp); FILE *fp2; fp2 = fopen("/dev/shm/interface","r"); + fgets(check, 500, fp2); + fclose(fp2); + if (strcmp(check, oldcheck) != 0){ + strcpy(oldcheck, check); + fp2 = fopen("/dev/shm/interface","r"); fgets(text2, 4, fp2); selected = atoi(text2); fgets(text2, 4, fp2); @@ -468,7 +476,10 @@ int main(void) } graphics_update_displayed_resource(img, 0, 0, 0, 0); } - usleep(100000); + sleeptime = 10000; + } + usleep(sleeptime); + sleeptime = 100000; } graphics_display_resource(img, 0, LAYER, 0, 0, GRAPHICS_RESOURCE_WIDTH, GRAPHICS_RESOURCE_HEIGHT, VC_DISPMAN_ROT0, 0);