Skip to content

Commit

Permalink
P2 is no longer configured as output by default since this was affect…
Browse files Browse the repository at this point in the history
…ing the ADC readings
  • Loading branch information
dberenguer committed Oct 30, 2015
1 parent 8fc9e9d commit ded386d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 1 addition & 2 deletions cores/panstamp/cc430core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ void CC430CORE::init(uint8_t vCore, uint16_t dcorsel, uint16_t flln)
REFCTL0 &= ~REFON;
REFCTL0 |= REFTCOFF; // Temp sensor disabled

// Config pins as outputs by default
// Config pins as outputs by default except P2, wich contains the ADC inputs
P1DIR = 0xFF;
P2DIR = 0xFF;
P3DIR = 0xFF;
PJDIR = 0xFF;
}
Expand Down
3 changes: 0 additions & 3 deletions cores/panstamp/wiring_analog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ uint16_t analogRead(uint8_t pin)
REFCTL0 &= ~REFON;
REFCTL0 |= REFTCOFF; // Temp sensor disabled

// Config pin as output to save current
*dir |= bit;

uint64_t result = ADC12MEM0;

if (refGain)
Expand Down

0 comments on commit ded386d

Please sign in to comment.