Skip to content

Commit f0a73b3

Browse files
committed
main: Delay before calling powerdown
Not sure why this delay is required, but without it the machine usually just resets. Clear the screen right away in response to the key though so we seem responsive.
1 parent e0e63c2 commit f0a73b3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

crt0.s

+4-2
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ _debug4::
212212
_exit::
213213
call _reboot
214214

215-
_powerdown_mode::
216-
call #0x0a6b ; firmware powerdownmode function
215+
_powerdown::
216+
di
217+
call #0x0a6b ; firmware powerdown function
218+
jp _panic ; in case we fail to powerdown somehow
217219

218220
_reboot::
219221
jp 0x0000

mailstation.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extern unsigned char debug4;
9393
/* crt0.s */
9494
extern unsigned char msTERM_version;
9595
extern void exit(void);
96-
extern void powerdown_mode(void);
96+
extern void powerdown(void);
9797
extern void new_mail(unsigned char on);
9898
extern void reboot(void);
9999
extern void delay(unsigned int millis);

main.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ process_keyboard(void)
266266

267267
switch (b) {
268268
case KEY_POWER:
269-
powerdown_mode();
269+
/* not sure why the delay is needed to actually power down */
270+
clear_screen();
271+
delay(200);
272+
powerdown();
270273
break;
271274
case KEY_F1:
272275
if (source == SOURCE_MODEM) {

0 commit comments

Comments
 (0)