- con(false);
- }
-
- void config(boolean bit) throws IOException { config(bit?1:0, 1); }
- void config(int dat) throws IOException { config(dat, 8); }
- void config(int dat, int numbits) throws IOException {
- for(int i=(numbits-1); i>=0; i--) {
- boolean bit = (dat & (1<<i)) != 0;
- data(bit);
- clk(true);
- clk(false);
- }
- }
-
- // tricky: RESET has a weak pull-up, and is wired to a CBUS line. So,
- // we can pull it down (assert reset) from uart-mode, or we can
- // let it float upward from either mode.
- void reset(boolean on) throws IOException {
- uart_and_cbus_mode(1<<1, on ? (1<<1) : 0);
- flush();
- if (on) {
- dbus_mode(dmask);
- flush();
- }
- }
-
- void avrrst(boolean on) throws IOException { dbang(7, on); }
- void clk(boolean on) throws IOException { dbang(6, on); }
- void data(boolean on) throws IOException { dbang(5, on); }
-
- boolean initErr() throws IOException { flush(); return (readPins() & (1<<4))!=0; }
+ pins.resetPin(true);
+ try { Thread.sleep(500); } catch (Exception e) { }
+ if (!pins.initPin()) throw new RuntimeException("INIT was still low after releasing RESET");