wonx/comm.c
Hiroaki Sakai 0f43e6d6ee Added interrupt handling. Timer interrupt support.
(UNIXTimer, WWInterrupt, WWTimer, WonxSystem addition)
According to interrupt support, compatibility functions are replaced with UNIXTimer_Pause (), UNIXTimer_Unpause ()
It hung around.
UNIXTimer, WWTimer, WonxSystem's callback functions,
It is necessary to check finely whether there are bugs peculiar to interrupts.
(The setting of the interrupt in the callback function may change, or from the callback function
It is necessary to check whether the callback function is called or not)

Version 0.2 beta - from wonx-b02.tar.gz
2018-03-07 23:05:54 +00:00

104 lines
2.3 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*****************************************************************************/
/* ここから */
/*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "sys/comm.h"
#include "Wonx.h"
/*****************************************************************************/
/* 互換関数の定義 */
/*****************************************************************************/
/*
* Xサーバとの同期の整合性がとれなくなるなどの問題が考えられるので
* 互換関数の内部は UNIXTimer_Pause(), UNIXTimer_Unpause() でくくり,
* タイマ割り込みを一時停止して処理を行うまたunpause するまえに,
* かならず sync するようにする.
*/
/*
* タイマの一時停止の2重解除の問題が出てくるので,
* 互換関数から互換関数を呼んではいけない.
* (一時停止はネストされるが,いちおう)
* 似たような処理をする関数の場合は,必ず static な別関数に処理をまとめ,
* そっちを呼び出すようにすること.
* 引数の表示の問題もあるしね.
*/
void comm_open(void)
{}
void comm_close(void)
{}
int comm_send_char(unsigned char byte)
{
return (0);
}
int comm_receive_char(void)
{
return (0);
}
int comm_receive_with_timeout(int timeout)
{
return (0);
}
int comm_send_string(char * string)
{
return (0);
}
int comm_send_block(void * buffer, int size)
{
return (0);
}
int comm_receive_block(void * buffer, int size)
{
return (0);
}
void comm_set_timeout(int receive_timeout, int send_timeout)
{
}
void comm_set_baudrate(int speed)
{
}
int comm_get_baudrate(void)
{
return (0);
}
void comm_set_cancel_key(unsigned int pattern)
{
}
unsigned int comm_get_cancel_key(void)
{
return (0);
}
#if 0
int comm_xmodem(void * xmodem)
{
return (0);
}
#endif
/*****************************************************************************/
/* ここまで */
/*****************************************************************************/
/*****************************************************************************/
/* End of File. */
/*****************************************************************************/