aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain
Commit message (Expand)AuthorAgeFilesLines
* uClibc: backport a fix for dlsym(RTLD_NEXT, ...) useFlorian Fainelli2012-11-111-0/+26
* build: remove remaining references to TOOLCHAIN_JOBS (thx, Sedat Dilek)Felix Fietkau2012-11-083-3/+3
* eglibc: update to r21110Florian Fainelli2012-10-311-1/+1
* eglibc: do not prompt for the revision, it is supposed to be changed by devel...Felix Fietkau2012-10-311-1/+0
* eglibc: remove versions 2.12-2.14Felix Fietkau2012-10-3112-361/+1
* eglibc: add a fake libintl.h for cross-rpcgen and cross-zic to fix build on m...Felix Fietkau2012-10-313-0/+29
* eglibc: enable parallel buildsFelix Fietkau2012-10-311-1/+2
* eglibc: disable NIS/SUNRPC by default. RPC support is provided by librpcFelix Fietkau2012-10-311-2/+2
* uClibc: backport support for assignment-allocation character %m in sscanfFelix Fietkau2012-10-291-0/+184
* toolchain: enable pthread debug support in uclibcFelix Fietkau2012-10-291-1/+1
* toolchain: enable parallel build for uClibc, remove the obsolete TOOLCHAIN_PA...Felix Fietkau2012-10-172-1/+3
* gcc: add GCC 4.7.2Florian Fainelli2012-10-1417-1/+9884
* gcc: add GCC 4.6.3Florian Fainelli2012-10-1418-1/+10066
* gcc: update 4.5-linaro to 4.5-2012.03Florian Fainelli2012-10-131-2/+2
* gcc: update 4.7-linaro to 4.7-2012.10Florian Fainelli2012-10-135-471/+3
* gcc: update gcc-4.6-linaro to 4.6-2012.10Florian Fainelli2012-10-133-205/+3
* gdb: update to 7.5-2012.09Florian Fainelli2012-10-132-15/+18
* eglibc: remove duplicate line introduced in r33738Florian Fainelli2012-10-121-1/+0
* gcc: add --with-long-double-128 for SPARC toolchainFlorian Fainelli2012-10-121-0/+1
* add support for eglibc 2.16Florian Fainelli2012-10-126-0/+406
* gcc: backport struct siginfo -> siginfo_t renamingFlorian Fainelli2012-10-124-0/+608
* build: add the + token to any commands that can pass through the jobserver, f...Felix Fietkau2012-09-234-4/+4
* uClibc: fix uClibc implementation of eventfdFlorian Fainelli2012-09-191-0/+59
* binutils: backport ld patch to fix ARM specific issues with --gc-sectionsFelix Fietkau2012-09-191-0/+12
* gcc: enable parallel buildsFelix Fietkau2012-09-154-3/+5
* binutils: enable parallel buildsFelix Fietkau2012-09-151-1/+3
* gdb: enable parallel buildsFelix Fietkau2012-09-151-4/+2
* gcc: add upstream fixes for GCC bug 54494Florian Fainelli2012-09-072-0/+74
* gcc: add upstream fixes for GCC bug 54369Florian Fainelli2012-09-074-0/+180
* kernel: fix portability issues on the x86 specific relocs host tool, fixes bu...Felix Fietkau2012-07-201-0/+1
* toolchain: sync eglibc headers/build split with uclibc changesFelix Fietkau2012-07-034-163/+134
* toolchain: fix libc headers dependency on kernel headers + minimal gccFelix Fietkau2012-07-031-1/+2
* uClibc: add -Wno-unused-but-set-variable to get rid of unnecessary warning lo...Felix Fietkau2012-06-301-0/+1
* uClibc: split the package into the main directory and the headers/ and utils/...Felix Fietkau2012-06-305-119/+170
* toolchain: fix up lib64 symlink to lib before copying the initial prefix dir ...Felix Fietkau2012-06-302-0/+3
* toolchain/uClibc: fix getting the nameserver from _res state after res_init. ...Felix Fietkau2012-06-301-0/+15
* toolchain/gcc: fix installing the toolchain after removing the toolchain dir ...Felix Fietkau2012-06-301-2/+8
* toolchain: keep the initial gcc around for later uclibc rebuildsFelix Fietkau2012-06-303-3/+10
* eglibc: work around a broken configure test to fix compile errors on x86Felix Fietkau2012-06-291-0/+1
* toolchain: enable gdb by defaultFelix Fietkau2012-06-281-1/+1
* toolchain/insight: update download location and MD5 sum to status quoJo-Philipp Wich2012-06-181-2/+2
* eglibc: use 2.15 by defaultFelix Fietkau2012-06-071-1/+1
* eglibc: add version 2.15Felix Fietkau2012-06-077-0/+169
* toolchain: install libgcc for minimal gcc, needed by newer eglibc versionsFelix Fietkau2012-06-071-2/+2
* uClibc: update to 0.9.33.2, fixes #4420Felix Fietkau2012-05-1540-59/+4
* uClibc: remove 0.9.32, it is no longer necessaryFelix Fietkau2012-05-1549-5856/+3
* kernel-headers: Fix patch application for kernel-headers and a patch that fix...Daniel Dickinson2012-05-132-1/+25
* switch to 2.6.38Imre Kaloz2012-05-011-7/+8
* purge support for glibc - use eglibc instead!Mirko Vogt2012-04-2818-420/+3
* drop support for eglibc version trunk/HEADMirko Vogt2012-04-283-10/+3
; static void init_cols(void); static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); static void unselect_rows(void); static void select_row(uint8_t row); __attribute__ ((weak)) void matrix_init_quantum(void) { matrix_init_kb(); } __attribute__ ((weak)) void matrix_scan_quantum(void) { matrix_scan_kb(); } __attribute__ ((weak)) void matrix_init_kb(void) { matrix_init_user(); } __attribute__ ((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } __attribute__ ((weak)) void matrix_init_user(void) { } __attribute__ ((weak)) void matrix_scan_user(void) { } inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } inline uint8_t matrix_cols(void) { return MATRIX_COLS; } void matrix_init(void) { /* To use PORTF disable JTAG with writing JTD bit twice within four cycles. */ #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) MCUCR |= _BV(JTD); MCUCR |= _BV(JTD); #endif mcp23018_status = true; /* initialize row and col */ unselect_rows(); init_cols(); /* initialize matrix state: all keys off */ for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix[i] = 0; matrix_debouncing[i] = 0; } matrix_init_quantum(); } uint8_t matrix_scan(void) { if (mcp23018_status) { /* if there was an error */ if (++mcp23018_reset_loop == 0) { /* since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans this will be approx bit more frequent than once per second */ print("trying to reset mcp23018\n"); mcp23018_status = init_mcp23018(); if (mcp23018_status) { print("left side not responding\n"); } else { print("left side attached\n"); } } } /* Set row, read cols */ for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { # if (DEBOUNCING_DELAY > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { debouncing = true; debouncing_time = timer_read(); } # else read_cols_on_row(matrix, current_row); # endif } # if (DEBOUNCING_DELAY > 0) if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } debouncing = false; } # endif matrix_scan_quantum(); return 1; } bool matrix_is_modified(void) { #if (DEBOUNCING_DELAY > 0) if (debouncing) return false; #endif return true; } inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1<<col)); } inline matrix_row_t matrix_get_row(uint8_t row) { /* Matrix mask lets you disable switches in the returned matrix data. For example, if you have a switch blocker installed and the switch is always pressed. */ #ifdef MATRIX_MASKED return matrix[row] & matrix_mask[row]; #else return matrix[row]; #endif } void matrix_print(void) { print_matrix_header(); for (uint8_t row = 0; row < MATRIX_ROWS; row++) { phex(row); print(": "); print_matrix_row(row); print("\n"); } } uint8_t matrix_key_count(void) { uint8_t count = 0; for (uint8_t i = 0; i < MATRIX_ROWS; i++) { count += matrix_bitpop(i); } return count; } static void init_cols(void) { for(uint8_t x = 0; x < ATMEGA_COLS; x++) { uint8_t pin = col_pins[x]; _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); /* IN */ _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); /* HI */ } } static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { /* Store last value of row prior to reading */ matrix_row_t last_row_value = current_matrix[current_row]; /* Clear data in matrix row */ current_matrix[current_row] = 0; /* Select row and wait for row selecton to stabilize */ select_row(current_row); wait_us(30); if (mcp23018_status) { /* if there was an error */ return 0; } else { uint16_t data = 0; mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out; mcp23018_status = i2c_start(I2C_ADDR_READ); if (mcp23018_status) goto out; data = i2c_readNak(); data = ~data; out: i2c_stop(); current_matrix[current_row] |= (data << 8); } /* For each col... */ for(uint8_t col_index = 0; col_index < ATMEGA_COLS; col_index++) { /* Select the col pin to read (active low) */ uint8_t pin = col_pins[col_index]; uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); /* Populate the matrix row with the state of the col pin */ current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); } /* Unselect row */ unselect_rows(); return (last_row_value != current_matrix[current_row]); } static void select_row(uint8_t row) { if (mcp23018_status) { /* if there was an error do nothing */ } else { /* set active row low : 0 set active row output : 1 set other rows hi-Z : 1 */ mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; mcp23018_status = i2c_write(GPIOB); if (mcp23018_status) goto out; mcp23018_status = i2c_write(0xFF & ~(1<<abs(row-4))); if (mcp23018_status) goto out; out: i2c_stop(); } uint8_t pin = row_pins[row]; _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); /* OUT */ _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); /* LOW */ } static void unselect_rows(void) { for(uint8_t x = 0; x < MATRIX_ROWS; x++) { uint8_t pin = row_pins[x]; _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); /* IN */ _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); /* HI */ } }