Avoid unnecessary key presses.
The recently added doesclrscrafterexit() allows cc65 programs to determine if the screen will be cleared after exit(). If that isn't the case then there's no need to ask the user to press a key in order to allow him to read the final program output.
This commit is contained in:
parent
957ac63a7c
commit
c25e965b0c
|
@ -35,6 +35,10 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef __CC65__
|
||||||
|
#include <cc65.h>
|
||||||
|
#endif /* __CC65__ */
|
||||||
|
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
#include "webclient.h"
|
#include "webclient.h"
|
||||||
#include "cfs/cfs.h"
|
#include "cfs/cfs.h"
|
||||||
|
@ -146,8 +150,12 @@ app_quit(void)
|
||||||
if(file != -1) {
|
if(file != -1) {
|
||||||
cfs_close(file);
|
cfs_close(file);
|
||||||
}
|
}
|
||||||
|
#ifdef __CC65__
|
||||||
|
if(doesclrscrafterexit()) {
|
||||||
puts("Press <enter> to continue...");
|
puts("Press <enter> to continue...");
|
||||||
getchar();
|
getchar();
|
||||||
|
}
|
||||||
|
#endif /* __CC65__ */
|
||||||
process_exit(&wget_process);
|
process_exit(&wget_process);
|
||||||
LOADER_UNLOAD();
|
LOADER_UNLOAD();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <cc65.h>
|
||||||
|
|
||||||
#include "sys/log.h"
|
#include "sys/log.h"
|
||||||
|
|
||||||
|
@ -43,8 +44,10 @@ void
|
||||||
error_exit(void)
|
error_exit(void)
|
||||||
{
|
{
|
||||||
#if LOG_CONF_ENABLED
|
#if LOG_CONF_ENABLED
|
||||||
|
if(doesclrscrafterexit()) {
|
||||||
log_message("Press any key to continue ...", "");
|
log_message("Press any key to continue ...", "");
|
||||||
ctk_arch_getkey();
|
ctk_arch_getkey();
|
||||||
|
}
|
||||||
#endif /* LOG_CONF_ENABLED */
|
#endif /* LOG_CONF_ENABLED */
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <cc65.h>
|
||||||
|
|
||||||
#include "sys/log.h"
|
#include "sys/log.h"
|
||||||
|
|
||||||
|
@ -43,8 +44,10 @@ void
|
||||||
error_exit(void)
|
error_exit(void)
|
||||||
{
|
{
|
||||||
#if LOG_CONF_ENABLED
|
#if LOG_CONF_ENABLED
|
||||||
|
if(doesclrscrafterexit()) {
|
||||||
log_message("Press any key to continue ...", "");
|
log_message("Press any key to continue ...", "");
|
||||||
ctk_arch_getkey();
|
ctk_arch_getkey();
|
||||||
|
}
|
||||||
#endif /* LOG_CONF_ENABLED */
|
#endif /* LOG_CONF_ENABLED */
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue