All pastes #214659 Raw Edit

Miscellany

public text v1 · immutable
#214659 ·published 2006-10-22 04:32 UTC
rendered paste body
int whatTheHellDirectionIsTheWindBlowingNow() {

  PTRType test;
  int n;
    
  test.PD7 = ISHIGH(7, PORTD);
  test.PD6 = ISHIGH(6, PORTD);
  test.PD5 = ISHIGH(5, PORTD);
  test.PD4 = ISHIGH(4, PORTD);
  test.PC2 = ISHIGH(2, PORTC);
  test.PC3 = ISHIGH(3, PORTC);
  test.PC4 = ISHIGH(4, PORTC);
  test.PC5 = ISHIGH(5, PORTC);   

  for (n = 0; n < 32; n++) {
    if( stateTable[n].state == test ) {
      return stateTable[n].next;
    }
  }
  
  return -1 // we dont know!?
  
}