1.1 --- a/src/sh4/scif.c Thu Dec 22 13:52:02 2005 +0000
1.2 +++ b/src/sh4/scif.c Thu Dec 22 13:57:26 2005 +0000
1.5 - * $Id: scif.c,v 1.2 2005-12-22 13:52:02 nkeynes Exp $
1.6 + * $Id: scif.c,v 1.3 2005-12-22 13:57:26 nkeynes Exp $
1.7 * SCIF (Serial Communication Interface with FIFO) implementation - part of the
1.8 * SH4 standard on-chip peripheral set. The SCIF is hooked up to the DCs
1.9 * external serial port
1.10 @@ -159,23 +159,35 @@
1.11 uint8_t data[FIFO_ARR_LENGTH];
1.14 +int SCIF_recvq_triggers[4] = {1, 4, 8, 14};
1.15 +struct SCIF_fifo SCIF_recvq = {0,0,1};
1.17 +int SCIF_sendq_triggers[4] = {8, 4, 2, 1};
1.18 +struct SCIF_fifo SCIF_sendq = {0,0,8};
1.21 + * Flag to indicate if data was received (ie added to the receive queue)
1.22 + * during the last SCIF clock tick. Used to determine when to set the DR
1.25 +gboolean SCIF_rcvd_last_tick = FALSE;
1.27 void SCIF_save_state( FILE *f )
1.30 + fwrite( &SCIF_recvq, sizeof(SCIF_recvq), 1, f );
1.31 + fwrite( &SCIF_sendq, sizeof(SCIF_sendq), 1, f );
1.32 + fwrite( &SCIF_rcvd_last_tick, sizeof(gboolean), 1, f );
1.36 int SCIF_load_state( FILE *f )
1.38 + fread( &SCIF_recvq, sizeof(SCIF_recvq), 1, f );
1.39 + fread( &SCIF_sendq, sizeof(SCIF_sendq), 1, f );
1.40 + fread( &SCIF_rcvd_last_tick, sizeof(gboolean), 1, f );
1.44 -int SCIF_recvq_triggers[4] = {1, 4, 8, 14};
1.45 -struct SCIF_fifo SCIF_recvq = {0,0,1};
1.47 -int SCIF_sendq_triggers[4] = {8, 4, 2, 1};
1.48 -struct SCIF_fifo SCIF_sendq = {0,0,8};
1.50 static inline uint8_t SCIF_recvq_size( )
1.52 int val = SCIF_recvq.tail - SCIF_recvq.head;
1.53 @@ -543,13 +555,6 @@
1.57 - * Flag to indicate if data was received (ie added to the receive queue)
1.58 - * during the last SCIF clock tick. Used to determine when to set the DR
1.61 -gboolean SCIF_rcvd_last_tick = FALSE;
1.64 * Actions for a single tick of the serial clock, defined as the transmission
1.65 * time of a single frame.