Skip to content

Commit 9a795f2

Browse files
committed
[iec] disable interrupts during EOI detect
1 parent 9abe7ab commit 9a795f2

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

include/cbm_defines.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ typedef enum
189189
#define TIMING_EMPTY 512 // SIGNAL EMPTY STREAM
190190
#define TIMEOUT_ATNCLK 70 // WAIT FOR CLK AFTER ATN IS PULLED
191191
#define TIMEOUT_Ttlta 65 // TALKER/LISTENER TURNAROUND TIMEOUT
192+
#define TIMING_Ttcp 13 // TALKER TURNAROUND CLOCK PULL
192193

193194
// SPECIAL
194195
#define TIMING_PROTOCOL_DETECT 218 // SAUCEDOS/JIFFYDOS CAPABLE DELAY

lib/bus/iec/protocol/cpbstandardserial.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ uint8_t CPBStandardSerial::receiveByte()
138138
// will do nothing. The listener should be watching, and if 200 microseconds pass
139139
// without the Clock line going to true, it has a special task to perform: note EOI.
140140

141-
IEC.pull ( PIN_IEC_SRQ );
141+
//IEC.pull ( PIN_IEC_SRQ );
142142
//if ( timeoutWait ( PIN_IEC_CLK_IN, PULLED, TIMING_Tye, false ) == TIMING_Tye )
143+
portDISABLE_INTERRUPTS();
143144
timer_start( TIMING_Tye );
144145
while ( IEC.status(PIN_IEC_CLK_IN) != PULLED )
145146
{
@@ -173,18 +174,22 @@ uint8_t CPBStandardSerial::receiveByte()
173174

174175
// Wait for clock line to be pulled
175176
//timeoutWait ( PIN_IEC_CLK_IN, PULLED, TIMING_Tye, false );
176-
//usleep( 2 );
177+
// IEC.pull( PIN_IEC_SRQ );
178+
// usleep( 1 );
179+
// IEC.release( PIN_IEC_SRQ );
180+
// usleep( 1 );
177181
}
178182
timer_stop();
179-
IEC.release ( PIN_IEC_SRQ );
183+
portENABLE_INTERRUPTS();
184+
//IEC.release ( PIN_IEC_SRQ );
180185

181186

182187
// Has ATN status changed?
183188
if ( atn_status != IEC.status ( PIN_IEC_ATN ) )
184189
{
185190
Debug_printv ( "ATN status changed!" );
186191
IEC.flags |= ATN_PULLED;
187-
return 0; // return error because timeout
192+
return 0;
188193
}
189194

190195

lib/device/iec/fuji.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,8 @@ device_state_t iecFuji::process()
139139

140140
if (commanddata.channel != CHANNEL_COMMAND)
141141
{
142-
Debug_printf("Meatloaf device only accepts on channel 15. Sending NOTFOUND.\r\n");
142+
Debug_printf("Meatloaf device only accepts communications on channel 15.\r\n");
143143
state = DEVICE_ERROR;
144-
IEC.senderTimeout();
145144
return state;
146145
}
147146

0 commit comments

Comments
 (0)