Skip to content

Commit

Permalink
converter/ibm_5291
Browse files Browse the repository at this point in the history
* Restore code from qmk#4483 to working order.
* qmk#13471 changed MATRIX_ROW_PINS to avoid warnings, rather than realizing that it didn't mean the same thing.
* qmk#13658 then removed it because it wouldn't compile after that.
* So, instead rename the PIN macros to not conflict with regular matrix scanning.
  • Loading branch information
MMcM committed Oct 22, 2022
1 parent 7c8a9b3 commit 0ed7838
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions keyboards/converter/ibm_5291/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MANUFACTURER QMK
#define PRODUCT 5291 keyboard converter

#define MATRIX_ROWS 5
#define MATRIX_ROWS 24
#define MATRIX_COLS 4

#define MATRIX_ROW_PINS {B2, B3, B4, B5, B6}
#define MATRIX_COL_PINS {B0, B1}
#define MATRIX_DATA_PIN D0
#define MATRIX_STROBE_PIN D1
#define IBM_5291_MATRIX_ROW_PINS {B2, B3, B4, B5, B6}
#define IBM_5291_MATRIX_COL_PINS {B0, B1}
#define IBM_5291_MATRIX_DATA_PIN D0
#define IBM_5291_MATRIX_STROBE_PIN D1
#define LED_PIN D6


Expand Down
12 changes: 6 additions & 6 deletions keyboards/converter/ibm_5291/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define NUM_ROW_PINS 5
#define NUM_COL_PINS 2

static const uint8_t row_pins [NUM_ROW_PINS] = MATRIX_ROW_PINS ;
static const uint8_t col_pins [NUM_ROW_PINS] = MATRIX_COL_PINS ;
static const uint8_t row_pins [NUM_ROW_PINS] = IBM_5291_MATRIX_ROW_PINS ;
static const uint8_t col_pins [NUM_ROW_PINS] = IBM_5291_MATRIX_COL_PINS ;

#if ( DEBOUNCE > 0 )
static uint16_t debouncing_time ;
Expand Down Expand Up @@ -78,15 +78,15 @@ void init_led(void) {
static
inline
void init_data(void) {
uint8_t pin = MATRIX_DATA_PIN ;
uint8_t pin = IBM_5291_MATRIX_DATA_PIN ;
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // LO
}

static
inline
void init_strobe(void) {
uint8_t pin = MATRIX_STROBE_PIN ;
uint8_t pin = IBM_5291_MATRIX_STROBE_PIN ;
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
Expand Down Expand Up @@ -142,8 +142,8 @@ void select_col(uint8_t current_col) {
static
inline
uint8_t matrix_strobe(uint8_t col_index) {
uint8_t strobe_pin = MATRIX_STROBE_PIN ;
uint8_t data_pin = MATRIX_DATA_PIN ;
uint8_t strobe_pin = IBM_5291_MATRIX_STROBE_PIN ;
uint8_t data_pin = IBM_5291_MATRIX_DATA_PIN ;

// set strobe pin low
_SFR_IO8((strobe_pin >> 4) + 2) &= ~_BV(strobe_pin & 0xF);
Expand Down
1 change: 1 addition & 0 deletions users/mmcm/mmcm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ make clueboard/2x1800/2019:mmcm SILENT=true &&
make converter/memorex_2051 SILENT=true &&
make keebio/bdn9/rev2:mmcm SILENT=true &&
make converter/nec_pc_8801 SILENT=true &&
make converter/ibm_5291 SILENT=true &&
true

0 comments on commit 0ed7838

Please sign in to comment.