jcs
/wifi_da
/amendments
/13
main: Use dNeedTime to get periodic runtime, not accCursor events
jcs made amendment 13 11 months ago
--- main.c Fri Oct 20 22:49:22 2023
+++ main.c Mon Oct 23 10:01:45 2023
@@ -65,10 +65,10 @@ main(cntrlParam *p, DCtlPtr d, short n)
switch (n) {
case 0:
- da_open();
+ da_open();
break;
case 2:
- da_control(p->csCode, p->csParam);
+ da_control(p->csCode, p->csParam);
break;
case 4:
da_close();
@@ -94,7 +94,8 @@ da_open(void)
Rect bounds;
bool dispose;
- dce->dCtlFlags |= dNeedLock | dNeedGoodBye;
+ dce->dCtlFlags |= dNeedLock | dNeedTime | dNeedGoodBye;
+ dce->dCtlDelay = 61;
#ifdef DEBUG_LOGGING
if (!logger) {
@@ -142,17 +143,17 @@ void
da_control(short code, short *param)
{
switch (code) {
- case accCursor:
- handle_timer();
- break;
case accMenu:
handle_menu(param[1]);
break;
case accEvent:
handle_event(*((EventRecord **)param));
break;
- case goodbye:
+ case accRun:
+ handle_timer();
break;
+ case goodbye:
+ break;
}
}
@@ -223,6 +224,8 @@ handle_timer(void)
if (!win)
return;
+
+ DEBUG_LOG(("%ld - handle_timer", Ticks));
switch (da_state) {
case STATE_SCANNING: