bool adj_time_pending
This commit is contained in:
parent
c017601fba
commit
a7ce955307
3 changed files with 24 additions and 22 deletions
|
@ -29,7 +29,7 @@ unsigned long old_instr = 0;
|
|||
/* int rece_instr = 0; */
|
||||
bool device_check = false;
|
||||
|
||||
int adj_time_pending = 0;
|
||||
bool adj_time_pending = false;
|
||||
|
||||
int set_t1;
|
||||
|
||||
|
@ -2277,7 +2277,7 @@ inline void schedule( void )
|
|||
}
|
||||
}
|
||||
|
||||
adj_time_pending = 0;
|
||||
adj_time_pending = false;
|
||||
|
||||
saturn.timer1 = set_t1 - ticks.t1_ticks;
|
||||
if ( ( saturn.t1_ctrl & 0x08 ) == 0 && saturn.timer1 <= 0 ) {
|
||||
|
@ -2289,7 +2289,7 @@ inline void schedule( void )
|
|||
|
||||
saturn.timer1 &= 0x0f;
|
||||
} else
|
||||
adj_time_pending = 1;
|
||||
adj_time_pending = true;
|
||||
}
|
||||
if ( sched_adjtime < schedule_event )
|
||||
schedule_event = sched_adjtime;
|
||||
|
|
|
@ -156,6 +156,7 @@ int init_serial( void )
|
|||
{
|
||||
if ( verbose )
|
||||
fprintf( stderr, "ioctl(IR, TCSETS) failed, errno = %d\n", errno );
|
||||
|
||||
ir_fd = -1;
|
||||
}
|
||||
}
|
||||
|
@ -177,6 +178,7 @@ void serial_baud( int baud )
|
|||
{
|
||||
if ( verbose )
|
||||
fprintf( stderr, "ioctl(IR, TCGETS) failed, errno = %d\n", errno );
|
||||
|
||||
ir_fd = -1;
|
||||
error = 1;
|
||||
}
|
||||
|
@ -266,6 +268,7 @@ void serial_baud( int baud )
|
|||
if ( ( ir_fd >= 0 ) && ( ( ttybuf.c_cflag & CBAUD ) == 0 ) ) {
|
||||
if ( verbose )
|
||||
fprintf( stderr, "can\'t set baud rate, using 9600\n" );
|
||||
|
||||
ttybuf.c_cflag |= B9600;
|
||||
}
|
||||
#endif
|
||||
|
@ -278,6 +281,7 @@ void serial_baud( int baud )
|
|||
{
|
||||
if ( verbose )
|
||||
fprintf( stderr, "ioctl(IR, TCSETS) failed, errno = %d\n", errno );
|
||||
|
||||
ir_fd = -1;
|
||||
error = 1;
|
||||
}
|
||||
|
@ -292,6 +296,7 @@ void serial_baud( int baud )
|
|||
{
|
||||
if ( verbose )
|
||||
fprintf( stderr, "ioctl(wire, TCGETS) failed, errno = %d\n", errno );
|
||||
|
||||
wire_fd = -1;
|
||||
ttyp = -1;
|
||||
error = 1;
|
||||
|
@ -341,6 +346,7 @@ void serial_baud( int baud )
|
|||
if ( ( ttyp >= 0 ) && ( ( ttybuf.c_cflag & CBAUD ) == 0 ) ) {
|
||||
if ( verbose )
|
||||
fprintf( stderr, "can\'t set baud rate, using 9600\n" );
|
||||
|
||||
ttybuf.c_cflag |= B9600;
|
||||
}
|
||||
#endif
|
||||
|
@ -353,6 +359,7 @@ void serial_baud( int baud )
|
|||
{
|
||||
if ( verbose )
|
||||
fprintf( stderr, "ioctl(wire, TCSETS) failed, errno = %d\n", errno );
|
||||
|
||||
wire_fd = -1;
|
||||
ttyp = -1;
|
||||
error = 1;
|
||||
|
@ -367,17 +374,17 @@ void transmit_char( void )
|
|||
if ( saturn.ir_ctrl & 0x04 ) {
|
||||
if ( ir_fd == -1 ) {
|
||||
saturn.tcs &= 0x0e;
|
||||
if ( saturn.io_ctrl & 0x04 ) {
|
||||
if ( saturn.io_ctrl & 0x04 )
|
||||
do_interupt();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if ( wire_fd == -1 ) {
|
||||
saturn.tcs &= 0x0e;
|
||||
if ( saturn.io_ctrl & 0x04 ) {
|
||||
if ( saturn.io_ctrl & 0x04 )
|
||||
do_interupt();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -385,33 +392,28 @@ void transmit_char( void )
|
|||
if ( saturn.ir_ctrl & 0x04 ) {
|
||||
if ( write( ir_fd, &saturn.tbr, 1 ) == 1 ) {
|
||||
saturn.tcs &= 0x0e;
|
||||
if ( saturn.io_ctrl & 0x04 ) {
|
||||
if ( saturn.io_ctrl & 0x04 )
|
||||
do_interupt();
|
||||
}
|
||||
} else {
|
||||
if ( errno != EAGAIN ) {
|
||||
if ( errno != EAGAIN )
|
||||
fprintf( stderr, "serial write error: %d\n", errno );
|
||||
}
|
||||
|
||||
saturn.tcs &= 0x0e;
|
||||
if ( saturn.io_ctrl & 0x04 ) {
|
||||
if ( saturn.io_ctrl & 0x04 )
|
||||
do_interupt();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( write( wire_fd, &saturn.tbr, 1 ) == 1 ) {
|
||||
saturn.tcs &= 0x0e;
|
||||
if ( saturn.io_ctrl & 0x04 ) {
|
||||
if ( saturn.io_ctrl & 0x04 )
|
||||
do_interupt();
|
||||
}
|
||||
} else {
|
||||
if ( errno != EAGAIN ) {
|
||||
if ( verbose )
|
||||
fprintf( stderr, "serial write error: %d\n", errno );
|
||||
}
|
||||
if ( errno != EAGAIN && verbose )
|
||||
fprintf( stderr, "serial write error: %d\n", errno );
|
||||
|
||||
saturn.tcs &= 0x0e;
|
||||
if ( saturn.io_ctrl & 0x04 ) {
|
||||
if ( saturn.io_ctrl & 0x04 )
|
||||
do_interupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define T1_TIMER 0
|
||||
/* #define T2_TIMER 1 /\* unused? *\/ */
|
||||
|
||||
extern int adj_time_pending;
|
||||
extern bool adj_time_pending;
|
||||
|
||||
extern int start_fields[ 19 ];
|
||||
extern int end_fields[ 19 ];
|
||||
|
|
Loading…
Reference in a new issue