summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2017-10-08 17:23:59 (GMT)
committer Ashish Gupta <ashmew2@gmail.com>2017-10-08 17:23:59 (GMT)
commit726d71d88bf9d96ade702992a7625ff56dcfac78 (patch)
tree8350fda6e23564fc9f4e3d6b0baf4b3b71a4da81
parent46fe390b976c932dd786becf40a42c4f95053365 (diff)
downloadlibnsfb-ashmew2/kolibri.tar.gz
libnsfb-ashmew2/kolibri.tar.bz2
Never wait indefinitely (as this messes with the Network Stack events via the content/fetcher)ashmew2/kolibri
-rw-r--r--src/surface/kolibri.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/surface/kolibri.c b/src/surface/kolibri.c
index 25b59e1..d1b5d4c 100644
--- a/src/surface/kolibri.c
+++ b/src/surface/kolibri.c
@@ -53,13 +53,6 @@ int kolibri_get_button_id(void)
}
}
-int kolibri_wait_for_event(void)
-{
- uint32_t __ret;
- __asm__ __volatile__ ("int $0x40":"=a"(__ret):"0"(10));
- return __ret;
-}
-
int kolibri_get_pressed_key(void)
{
uint16_t __ret;
@@ -243,8 +236,7 @@ static int kolibri_surface_initialise(nsfb_t *nsfb)
EVENT_BUTTON |
EVENT_MOUSE_CHANGE |
EVENT_INACTIVE_NO_CURSOR |
- EVENT_INACTIVE_NO_MOUSE |
- EVENT_NETWORK);
+ EVENT_INACTIVE_NO_MOUSE);
return 0;
}
@@ -364,19 +356,19 @@ int ispowerkey(int scancode)
}
static bool kolibri_surface_input(nsfb_t *nsfb, nsfb_event_t *event,
- int timeout)
+ int timeout)
{
int got_event;
static int scanfull = 0;
char event_num[20];
+
nsfb = nsfb; /* unused */
+ /* schedule_run from gui.c might have returned negative for wait forever. This stalls us completely for network etc.
+ Don't do that. Always try to yield back to scheduler asap */
- if (timeout >= 0) {
- got_event = kolibri_wait_for_event_with_timeout(timeout / 10);
- } else {
- got_event = kolibri_wait_for_event();
- }
+ if(timeout < 0) timeout = 100; /* millis */
+ got_event = kolibri_wait_for_event_with_timeout(timeout / 10);
if (got_event == 0) {
return false;