mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
Some gliches and filenames are changed regarding RS-232C driver.
This commit is contained in:
parent
2f4970e61c
commit
259c5a00b9
@ -2,7 +2,7 @@
|
||||
# Makefile for z80/SDCC
|
||||
# @author Takahide Matsutsuka <markn@markn.org>
|
||||
#
|
||||
# $Id: Makefile.z80,v 1.3 2007/09/09 12:20:12 matsutsuka Exp $
|
||||
# $Id: Makefile.z80,v 1.4 2007/09/09 13:41:15 matsutsuka Exp $
|
||||
#
|
||||
|
||||
### Compiler definitions
|
||||
@ -21,7 +21,7 @@ AROPTS = -a
|
||||
|
||||
CONTIKI_CPU_DIRS = . dev lib
|
||||
CONTIKI_SOURCEFILES += strcasecmp.c mtarch.c uip_arch.c \
|
||||
log-conio.c libconio_arch.c rs-232.c
|
||||
libconio_arch.c log-conio.c rs232.c
|
||||
CONTIKI_ASMFILES += uip_arch-asm.S
|
||||
|
||||
contiki-$(TARGET).o: $(CONTIKI_OBJECTFILES) $(PROJECT_OBJECTFILES) $(CONTIKI_ASMOBJECTFILES)
|
||||
|
@ -27,7 +27,7 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rs-232.c,v 1.1 2007/09/09 12:22:34 matsutsuka Exp $
|
||||
* $Id: rs232.c,v 1.1 2007/09/09 13:41:15 matsutsuka Exp $
|
||||
*
|
||||
*/
|
||||
/*
|
||||
@ -39,25 +39,30 @@
|
||||
|
||||
#include "contiki.h"
|
||||
#include "serial.h"
|
||||
#include "rs-232.h"
|
||||
#include "rs232.h"
|
||||
#include "log.h"
|
||||
|
||||
PROCESS(rs232_process, "RS323C polling process");
|
||||
PROCESS(rs232_process, "RS-232C polling process");
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS_THREAD(rs232_process, ev, data)
|
||||
{
|
||||
static struct etimer timer;
|
||||
char ch;
|
||||
PROCESS_BEGIN();
|
||||
|
||||
rs232_arch_init();
|
||||
etimer_set(&timer, CLOCK_SECOND / 16);
|
||||
|
||||
while(1) {
|
||||
etimer_set(&timer, CLOCK_SECOND / 16);
|
||||
PROCESS_WAIT_EVENT();
|
||||
if(ev == PROCESS_EVENT_TIMER) {
|
||||
ch = rs232_poll();
|
||||
|
||||
if (etimer_expired(&timer)) {
|
||||
ch = rs232_arch_poll();
|
||||
if (ch != 0) {
|
||||
/* We have an input data */
|
||||
serial_input_byte(ch);
|
||||
}
|
||||
etimer_reset(&timer);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rs-232.h,v 1.1 2007/09/09 12:22:34 matsutsuka Exp $
|
||||
* $Id: rs232.h,v 1.1 2007/09/09 13:41:15 matsutsuka Exp $
|
||||
*
|
||||
*/
|
||||
/*
|
||||
@ -45,18 +45,18 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* RS-232C initialize.
|
||||
* An architecture-depend implementation of RS-232C initialization.
|
||||
*/
|
||||
void rs232_arch_init(void);
|
||||
|
||||
/*
|
||||
* RS-232C polling.
|
||||
* An architecture-depend implementation of RS-232C polling.
|
||||
* @return character, zero if no input.
|
||||
*/
|
||||
unsigned char rs232_arch_poll(void);
|
||||
|
||||
/*
|
||||
* RS-232C write a byte.
|
||||
* An architecture-depend implementation of RS-232C writing a byte.
|
||||
*/
|
||||
void rs232_arch_writeb(u8_t ch);
|
||||
|
Loading…
Reference in New Issue
Block a user