2011-07-07 15:41:53 +02:00
|
|
|
/* Public Domain Curses */
|
|
|
|
/* This file is BSD licensed, Copyright 2011 secunet AG */
|
|
|
|
|
|
|
|
#include "lppdc.h"
|
2013-03-25 23:38:21 +01:00
|
|
|
#include <curses.h>
|
2011-07-07 15:41:53 +02:00
|
|
|
#include <libpayload.h>
|
|
|
|
|
|
|
|
int curses_flags = F_ENABLE_SERIAL | F_ENABLE_CONSOLE;
|
|
|
|
|
|
|
|
void PDC_beep(void)
|
|
|
|
{
|
|
|
|
PDC_LOG(("PDC_beep() - called\n"));
|
|
|
|
|
2013-08-09 13:27:35 +02:00
|
|
|
#ifdef CONFIG_LP_SPEAKER
|
2011-07-07 15:41:53 +02:00
|
|
|
speaker_tone(1760, 500); /* 1760 == note A6 */
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void PDC_napms(int ms)
|
|
|
|
{
|
|
|
|
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
|
|
|
|
|
|
|
|
mdelay(ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *PDC_sysname(void)
|
|
|
|
{
|
|
|
|
return "LIBPAYLOAD";
|
|
|
|
}
|
|
|
|
|
|
|
|
void curses_enable_serial(int enable)
|
|
|
|
{
|
|
|
|
curses_flags = (curses_flags & ~F_ENABLE_SERIAL) | (enable * F_ENABLE_SERIAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void curses_enable_vga(int enable)
|
|
|
|
{
|
|
|
|
curses_flags = (curses_flags & ~F_ENABLE_CONSOLE) | (enable * F_ENABLE_CONSOLE);
|
|
|
|
}
|
|
|
|
|
2013-03-25 23:38:21 +01:00
|
|
|
int curses_serial_enabled(void)
|
2011-07-07 15:41:53 +02:00
|
|
|
{
|
|
|
|
return !!(curses_flags & F_ENABLE_SERIAL);
|
|
|
|
}
|
|
|
|
|
2013-03-25 23:38:21 +01:00
|
|
|
int curses_vga_enabled(void)
|
2011-07-07 15:41:53 +02:00
|
|
|
{
|
|
|
|
return !!(curses_flags & F_ENABLE_CONSOLE);
|
|
|
|
}
|