Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FuelGauge: return error if it failed to read/write registers. #2094

Merged
merged 1 commit into from
May 18, 2020

Conversation

XuGuohui
Copy link
Member

@XuGuohui XuGuohui commented May 6, 2020

Problem

Returned value of FuelGauge's wiring APIs cannot indicate error on failed.

Steps to Test

  1. Build and flash the following example application for B5SoM that is attached on SoM evaluation board.
  2. Connect the SoM evaluation board to serial terminal.
  3. Detach the jumper for PM_SCL or PM_SDA and see if a negative value is printed on serial terminal.

Example App

#include "Particle.h"

SYSTEM_MODE(MANUAL);

SerialLogHandler log(115200, LOG_LEVEL_ALL);

void setup()
{
    Serial.begin(115200);
    while(!Serial.isConnected());
    LOG(TRACE, "Application started.");
}

void loop() {
    FuelGauge gauge;
    LOG(TRACE, "SoC: %4.2f %%", gauge.getSoC());
    delay(1000);
}

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@XuGuohui XuGuohui requested a review from avtolstoy May 6, 2020 07:05
wiring/inc/spark_wiring_i2c.h Outdated Show resolved Hide resolved
hal/src/stm32f2xx/i2c_hal.c Outdated Show resolved Hide resolved
@avtolstoy avtolstoy added this to the 2.0.0 milestone May 14, 2020
@XuGuohui XuGuohui requested a review from avtolstoy May 15, 2020 04:15
@avtolstoy avtolstoy added ready to merge PR has been reviewed and tested and removed needs review labels May 15, 2020
@XuGuohui XuGuohui merged commit 7ac6216 into develop May 18, 2020
@XuGuohui XuGuohui deleted the fix/fuelgauge/ch52809 branch May 18, 2020 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready to merge PR has been reviewed and tested
Projects
None yet
2 participants