Skip to content

Commit

Permalink
Fix init resolution for all architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
code8buster authored Feb 8, 2024
1 parent 990ee5d commit ca5795d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,9 @@ bool Power::analogInit()
#else
analogReference(AR_INTERNAL); // 3.6V
#endif
analogReadResolution(BATTERY_SENSE_RESOLUTION_BITS); // Default of 12 is not very linear. Recommended to use 10 or 11
// depending on needed resolution.

#endif // ARCH_NRF52

analogReadResolution(BATTERY_SENSE_RESOLUTION_BITS);

batteryLevel = &analogLevel;
return true;
#else
Expand Down Expand Up @@ -900,4 +898,4 @@ bool Power::axpChipInit()
#else
return false;
#endif
}
}

0 comments on commit ca5795d

Please sign in to comment.