// Bit-banged implementation without any use of interrupts. // Data pin must have external 1K pull-up resistor. // Operates data pin as open-collector output. #include "adb_blargg.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include // Copyright 2011 Jun WAKO // Copyright 2013 Shay Green // See bottom of file for license typedef uint8_t byte; // Make loop iteration take us total, including cyc overhead of loop logic #define delay_loop_usec( us, cyc ) \ __builtin_avr_delay_cycles( (unsigned long) (F_CPU / 1e6 * (us) + 0.5) - (cyc) ) #if !defined(ADB_PORT) || \ !defined(ADB_PIN) || \ !defined(ADB_DDR) || \ !defined(ADB_DATA_BIT) #error #endif enum { data_mask = 1<