Skip to content

Commit 2936333

Browse files
committed
Remove unused functions.
1 parent abce4d5 commit 2936333

File tree

2 files changed

+0
-128
lines changed

2 files changed

+0
-128
lines changed

lib/bus/iec/iec.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -526,51 +526,28 @@ bool IRAM_ATTR systemBus::turnAround()
526526
*/
527527

528528
// Wait for ATN to be released
529-
#ifdef COMPLEX_WAIT
530-
if (protocol->timeoutWait(PIN_IEC_ATN, IEC_RELEASED, FOREVER) == TIMED_OUT)
531-
{
532-
Debug_printv("ATN failed to release");
533-
flags |= ERROR;
534-
return false;
535-
}
536-
#else
537529
if (protocol->waitForSignals(PIN_IEC_ATN, IEC_RELEASED, 0, 0, FOREVER) == TIMED_OUT)
538530
{
539531
Debug_printv("ATN failed to release");
540532
flags |= ERROR;
541533
return false;
542534
}
543-
#endif
544535

545536
// Wait for CLK to be released
546-
#ifdef COMPLEX_WAIT
547-
if (protocol->timeoutWait(PIN_IEC_CLK_IN, IEC_RELEASED, TIMEOUT_Ttlta, false) == TIMEOUT_Ttlta)
548-
{
549-
Debug_printv("Wait until the computer releases the CLK line\r\n");
550-
Debug_printv("IEC: TURNAROUND TIMEOUT\r\n");
551-
flags |= ERROR;
552-
return false; // return error because timeout
553-
}
554-
#else
555537
if (protocol->waitForSignals(PIN_IEC_CLK_IN, IEC_RELEASED, 0, 0, TIMEOUT_Ttlta) == TIMED_OUT)
556538
{
557539
Debug_printv("Wait until the computer releases the CLK line\r\n");
558540
Debug_printv("IEC: TURNAROUND TIMEOUT\r\n");
559541
flags |= ERROR;
560542
return false; // return error because timeout
561543
}
562-
#endif
563544

564545
IEC_RELEASE( PIN_IEC_DATA_OUT );
565546
IEC_ASSERT( PIN_IEC_CLK_OUT );
566547

567548
// 80us minimum delay after TURNAROUND
568549
// *** IMPORTANT!
569-
#ifdef COMPLEX_WAIT
570-
protocol->wait( TIMING_Tda );
571-
#else
572550
usleep(TIMING_Tda);
573-
#endif
574551

575552
return true;
576553
} // turnAround

lib/bus/iec/protocol/_protocol.cpp

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -53,110 +53,6 @@ void IECProtocol::timer_stop()
5353
//IEC.release( PIN_IEC_SRQ );
5454
}
5555

56-
#ifdef COMPLEX_WAIT
57-
int16_t IRAM_ATTR IECProtocol::timeoutWait(uint8_t pin, bool target_status, size_t wait_us, bool watch_atn)
58-
{
59-
uint64_t start = 0;
60-
uint64_t current = 0;
61-
uint64_t elapsed = 0;
62-
63-
#ifndef IEC_SPLIT_LINES
64-
IEC_RELEASE ( pin );
65-
#endif
66-
67-
// Quick check to see if the target status is already set
68-
if ( IEC_IS_ASSERTED( pin ) == target_status )
69-
return elapsed;
70-
71-
if ( pin == PIN_IEC_ATN )
72-
{
73-
watch_atn = false;
74-
}
75-
else
76-
{
77-
#ifndef IEC_SPLIT_LINES
78-
IEC_RELEASE( PIN_IEC_ATN );
79-
#endif
80-
81-
// Sample ATN and set flag to indicate COMMAND or DATA mode
82-
if( IEC_IS_ASSERTED( PIN_IEC_ATN ) )
83-
IEC.flags |= ATN_ASSERTED;
84-
}
85-
86-
//IEC_PULL( PIN_IEC_SRQ );
87-
start = esp_timer_get_time();
88-
while ( IEC_IS_ASSERTED( pin ) != target_status )
89-
{
90-
current = esp_timer_get_time();
91-
elapsed = ( current - start );
92-
93-
if ( elapsed >= wait_us && wait_us != FOREVER )
94-
{
95-
//IEC_RELEASE( PIN_IEC_SRQ );
96-
if ( wait_us == TIMEOUT_DEFAULT )
97-
return -1;
98-
99-
return wait_us;
100-
}
101-
102-
if ( watch_atn )
103-
{
104-
if ( IEC.flags & ATN_ASSERTED )
105-
return -1;
106-
}
107-
108-
if ( /*IEC.state < BUS_ACTIVE ||*/ elapsed > FOREVER )
109-
{
110-
// Something is messed up. Get outta here.
111-
// FOREVER really isn't forever
112-
//Debug_printv("wth? bus_state[%d]", IEC.state);
113-
Debug_printv("pin[%d] target_status[%d] wait[%d] elapsed[%d]", pin, target_status, wait_us, elapsed);
114-
return -1;
115-
}
116-
}
117-
//IEC_RELEASE( PIN_IEC_SRQ );
118-
119-
// Debug_printv("pin[%d] state[%d] wait[%d] step[%d] t[%d]", pin, target_status, wait, elapsed);
120-
return elapsed;
121-
}
122-
123-
bool IRAM_ATTR IECProtocol::wait(size_t wait_us, bool watch_atn)
124-
{
125-
return wait(wait_us, 0, watch_atn);
126-
}
127-
128-
bool IRAM_ATTR IECProtocol::wait(size_t wait_us, uint64_t start, bool watch_atn)
129-
{
130-
uint64_t current, elapsed;
131-
current = 0;
132-
elapsed = 0;
133-
134-
if ( wait_us == 0 ) return true;
135-
wait_us--; // Shave 1us for overhead
136-
137-
//IEC_PULL( PIN_IEC_SRQ );
138-
if ( start == 0 ) start = esp_timer_get_time();
139-
while ( elapsed <= wait_us )
140-
{
141-
current = esp_timer_get_time();
142-
elapsed = current - start;
143-
144-
if ( watch_atn )
145-
{
146-
if ( IEC_IS_ASSERTED( PIN_IEC_ATN ) )
147-
{
148-
IEC.flags |= ATN_ASSERTED;
149-
//IEC_RELEASE( PIN_IEC_SRQ );
150-
//Debug_printv("wait[%d] elapsed[%d] start[%d] current[%d]", wait, elapsed, start, current);
151-
return false;
152-
}
153-
}
154-
}
155-
//IEC_RELEASE( PIN_IEC_SRQ );
156-
157-
return true;
158-
}
159-
#else // !COMPLEX_WAIT
16056
int IRAM_ATTR IECProtocol::waitForSignals(int pin1, int state1,
16157
int pin2, int state2,
16258
int timeout)
@@ -182,7 +78,6 @@ int IRAM_ATTR IECProtocol::waitForSignals(int pin1, int state1,
18278

18379
return abort ? TIMED_OUT : 0;
18480
}
185-
#endif // COMPLEX_WAIT
18681

18782
void IECProtocol::transferDelaySinceLast(size_t minimumDelay)
18883
{

0 commit comments

Comments
 (0)