Skip to content

Commit

Permalink
Fix broken digital I/O configuration
Browse files Browse the repository at this point in the history
Pin misconfiguration protection has been broken twice now. Just
removing the not-a-pin check for now. It should probably infinitely
loop instead of quick-returning, but remove it for now.
  • Loading branch information
mdclyburn committed Nov 22, 2019
1 parent 0281e65 commit 23e45d1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/digital-io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,14 @@ namespace mardev::msp430::digital_io
const Function func)
{
const uint8_t port = get_pin_port(pin_number);
if(port == 0) // Guard against not-a-pin.
{
return;
}
const uint8_t port_mask = get_pin_port_mask(pin_number);

if(port_mask == 0)
{
/** Sanity check against incorrect pin number to port mask mapping.
* Something is wrong with the library code if this gets hit.
*/
return;
while(true);
}

// Set input or output.
Expand Down

0 comments on commit 23e45d1

Please sign in to comment.