/* Refresh display on terminal. 
Update the terminal display to show the current menu and the current time depending on the device state.  */
static void refresh_display(void)
/* Refresh display on terminal. 
Update the terminal display to show the current menu and the current time depending on the device state.  */
static void refresh_display(void)
{
	printf("%c[2J\r", 27);
	printf("Time: %u\n\r", (unsigned int)rtt_read_timer_value(RTT));
	if (g_uc_alarmed) {
		puts("!!! ALARM !!!\r");
	}
	if (g_uc_state == STATE_MAIN_MENU) {
		puts("Menu:\n\r"
				" r - Reset timer\n\r"
				" s - Set alarm\r");
		if (g_uc_alarmed) {
			puts(" c - Clear alarm notification\r");
		}
		puts("\n\rChoice? ");
	} else {
		if (g_uc_state == STATE_SET_ALARM) {
			puts("Enter alarm time: ");
			if (g_ul_new_alarm != 0) {
				printf("%u", (unsigned)g_ul_new_alarm);
			}
		}
	}
}