wonx/Wonx.c
Hiroaki Sakai 96b108c909 In UNIXTimer.c, callback function is called every time the callback function is called
Fix to reconfigure.
(Add signal () in UNIXTimer_ON ())
(In IRIX, coping with the fact that the callback function is cleared for each call)

Since ualarm () is BSD dependent, it is modified to use alarm ().

Unit Timer class interval time setting unit changed from microseconds to milliseconds.

Supports serial communication.  (See WonxSerialPort, WWSerialPort, comm.c)

With printf () in key.c, when the function name was not displayed when displaying the return value
Fix.

Version 0.4 beta - from wonx-b04.tar.gz
2018-03-07 23:06:28 +00:00

69 lines
1.6 KiB
C

#include "WonxP.h"
#include "etc.h"
#include "wonx_include/disp.h"
#include "wonx_include/text.h"
#include "wonx_include/system.h"
#include "wonx_include/comm.h"
/*****************************************************************************/
/* ディスプレイの確保 */
/*****************************************************************************/
static Wonx wonx = NULL;
int Wonx_IsCreated(void)
{
return (wonx != NULL);
}
void Wonx_Create(void)
{
WWScreen screen;
WWPalette palette;
wonx = (Wonx)malloc(sizeof(_Wonx));
if (wonx == NULL) Wonx_Error("Wonx_Create", "Cannot allocate memory.");
wonx->wonx_display =
WonxDisplay_Create(LCD_PIXEL_WIDTH * 2, LCD_PIXEL_HEIGHT * 2,
LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT,
SCREEN_CHAR_WIDTH, SCREEN_CHAR_HEIGHT);
screen =
WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(wonx->wonx_display), SCREEN2);
/* デフォルトのテキスト表示用パレットは0 */
palette =
WWDisplay_GetPalette(WonxDisplay_GetWWDisplay(wonx->wonx_display), 0);
wonx->wonx_text =
WonxText_Create(screen, 0, 0, TEXT_SCREEN_WIDTH, TEXT_SCREEN_HEIGHT,
palette);
wonx->wonx_system = WonxSystem_Create();
wonx->wonx_serial_port = WonxSerialPort_Create();
return;
}
WonxDisplay Wonx_GetWonxDisplay(void)
{
return (wonx->wonx_display);
}
WonxText Wonx_GetWonxText(void)
{
return (wonx->wonx_text);
}
WonxSystem Wonx_GetWonxSystem(void)
{
return (wonx->wonx_system);
}
WonxSerialPort Wonx_GetWonxSerialPort(void)
{
return (wonx->wonx_serial_port);
}