MAX14690 Library
Dependents: MAX32630HSP3_IMU_HelloWorld MAX32630HSP3_IMU_HelloWorld max32630fthr max4146x_comp ... more
Fork of MAX14690 by
Revision 7:2e9f6e70b34f, committed 2016-10-06
- Comitter:
- switches
- Date:
- Thu Oct 06 21:33:25 2016 +0000
- Parent:
- 6:06450093da48
- Child:
- 8:2c3f2da51c5d
- Commit message:
- Moved result check inside if statement to avoid checking an uninitialized variable. Added additional note to register write command warning about breaking synchronization with variable by bypassing other functions.
Changed in this revision
| MAX14720.cpp | Show annotated file Show diff for this revision Revisions of this file |
| MAX14720.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MAX14720.cpp Thu Oct 06 17:10:56 2016 +0000
+++ b/MAX14720.cpp Thu Oct 06 21:33:25 2016 +0000
@@ -122,15 +122,15 @@
}
if (boostEn == BOOST_ENABLED) {
result = writeReg(REG_BOOST_CFG, 0x00);
+ if (result == MAX14720_ERROR) return result;
}
- if (result == MAX14720_ERROR) return result;
result = writeReg(REG_BOOST_VSET, data);
if (result == MAX14720_ERROR) return result;
if (boostEn == BOOST_ENABLED) {
data = (boostEn << 3) | (boostEMI << 1) | (boostInd);
result = writeReg(REG_BOOST_CFG, data);
+ if (result == MAX14720_ERROR) return result;
}
- if (result == MAX14720_ERROR) return result;
return 0;
}
--- a/MAX14720.h Thu Oct 06 17:10:56 2016 +0000
+++ b/MAX14720.h Thu Oct 06 21:33:25 2016 +0000
@@ -271,7 +271,13 @@
/**
* @brief Write Register
- * @details Writes the given value to the specified register
+ * @details Writes the given value to the specified register.
+ * Note, this function provides direct access to the registers
+ * without any awareness or effect on the settings stored in
+ * the public variables. This is used by the other functions to
+ * set the values inside the MAX14720. Calling this outside of the
+ * other functions can break the synchronization of the variables
+ * to the state of the MAX14720.
* @param reg The register to be written
* @param value The data to be written
* @returns 0 if no errors, -1 if error.
