diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2014-11-25 16:33:49 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2014-11-25 16:33:49 +0100 |
commit | 1d0d6f316707cbaac23b3b0b77b5d554f6e7954d (patch) | |
tree | 242b82e999bfa6bbf4365661f66511d8c08e5890 | |
parent | 5b152c8515de5b23872247c8b16dae27404cda4f (diff) | |
download | hourglass-1d0d6f316707cbaac23b3b0b77b5d554f6e7954d.tar.gz hourglass-1d0d6f316707cbaac23b3b0b77b5d554f6e7954d.tar.bz2 hourglass-1d0d6f316707cbaac23b3b0b77b5d554f6e7954d.zip |
gyro/accel: Disable pull-ups
Not sure they are needed.
-rw-r--r-- | accel.c | 11 | ||||
-rw-r--r-- | gyro.c | 7 |
2 files changed, 8 insertions, 10 deletions
@@ -53,8 +53,8 @@ static bool reading = false; */ ISR(PCINT1_vect) { const bool interrupt = (PINC >> PINC1) & 0x1; - /* low-active */ - if (!interrupt) { + /* high-active */ + if (interrupt) { enableWakeup (WAKE_ACCEL); } else { disableWakeup (WAKE_ACCEL); @@ -62,9 +62,8 @@ ISR(PCINT1_vect) { } void accelInit () { - /* set interrupt lines to input with pull-up */ + /* set interrupt lines to input */ DDRC = DDRC & ~((1 << DDC0) | (1 << DDC1)); - PORTC = PORTC | (1 << PORTC0) | (1 << PORTC1); /* enable interrupt PCI1 for PCINT8/9 */ PCICR = PCICR | (1 << PCIE1); /* enable interrupts from port PC0/PC1 aka PCINT8/PCINT9 */ @@ -76,9 +75,9 @@ void accelStart () { /* configuration: * disable power-down-mode, enable z-axis * defaults - * low active, data ready interrupt on int2 + * push-pull, high-active, data ready interrupt on int2 */ - uint8_t data[] = {0b01000100, 0b0, 0b10100000}; + uint8_t data[] = {0b01000100, 0b0, 0b00100000}; if (!twRequest (TWM_WRITE, LIS302DL, LIS302DL_CTRLREG1, data, sizeof (data)/sizeof (*data))) { @@ -42,9 +42,8 @@ ISR(PCINT0_vect) { } void gyroInit () { - /* set PB1 to input, with pull-up */ + /* set PB1 to input */ DDRB = DDRB & ~((1 << DDB1)); - PORTB = PORTB | (1 << PORTB1); /* enable interrupt PCI0 */ PCICR = PCICR | (1 << PCIE0); /* enable interrupts on PB1/PCINT1 */ @@ -56,10 +55,10 @@ void gyroStart () { /* configuration: * disable power-down-mode, enable z * defaults - * low-active (does not work?), push-pull, drdy on int2 + * high-active, push-pull, drdy on int2 * select 2000dps */ - uint8_t data[] = {0b00001100, 0b0, 0b00101000, 0b00110000}; + uint8_t data[] = {0b00001100, 0b0, 0b00001000, 0b00110000}; if (!twRequest (TWM_WRITE, L3GD20, L3GD20_CTRLREG1, data, sizeof (data)/sizeof (*data))) { |