We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 140c954 commit cf9b9edCopy full SHA for cf9b9ed
components/sensors/power_monitor/ina236/ina236.c
@@ -133,11 +133,7 @@ esp_err_t ina236_get_current(ina236_handle_t handle, float *curr)
133
uint16_t buffer = 0;
134
ina236_t *ina236 = (ina236_t *)handle;
135
ina236_read_reg(ina236, INA236_REG_VSHUNT, &buffer);
136
- if ((buffer & 0x8000) >> 15) {
137
- *curr = 0;
138
- } else {
139
- *curr = buffer / 3970.0f;
140
- }
+ *curr = (int16_t)buffer / 3970.0f;
141
return ESP_OK;
142
}
143
0 commit comments