Revision 1a197672 MatrixScan.c

View differences:

MatrixScan.c
74 74

  
75 75
  /**
76 76
   * this is debug output, but not the end
77
   */
78
  /*
79
  // push initial 1
80
  pushBit(1);
81
  //for(uint8_t i = 0; i < 7; i++){
77
   *
78

  
79
  pushBit(1);  // push initial 1
80
  //for(uint8_t i = 0; i < ROW; i++) {
82 81
  //        pushBit(0); // to get the 1 on the first output
83 82
  //}
84 83
  // scan matrix
85 84
  uint8_t somethingPressed = 0;
86
  for(uint8_t i = 0; i < 18; ++i){
85
  for(uint8_t i = 0; i < COL; ++i) {
87 86
    _delay_us(100);
88 87
    matrixState[i] = DATAINPIN;
89
    if(matrixState[i] != 0){
88
    if(matrixState[i] != 0) {
90 89
      ReportData->KeyCode[0] = HID_KEYBOARD_SC_A + i;
91 90
      for(uint8_t bit = 0; bit < ROW; bit++){
92
  	if(matrixState[i] & (1<<bit) ){
93
  	  ReportData->KeyCode[1] = HID_KEYBOARD_SC_1_AND_EXCLAMATION + bit;
94
  	}
91
        if(matrixState[i] & (1<<bit) ){
92
          ReportData->KeyCode[1] = HID_KEYBOARD_SC_1_AND_EXCLAMATION + bit;
93
        }
95 94
      }
96 95
    }
97 96
    pushBit(0);
......
99 98
  // set mods (check if >= 0xe0)
100 99
  clearSR();
101 100
  return;
102
  */
103

  
101
  /**/
104 102

  
105 103
	// push initial 1
106 104
	pushBit(1);

Also available in: Unified diff