Skip to content

Commit

Permalink
AP_ADC: read correct byte count
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Mar 14, 2024
1 parent 4f5ea32 commit 068e3b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/AP_ADC/AP_ADC_ADS1115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void AP_ADC_ADS1115::_update()
uint8_t config[2];
be16_t val;

if (!_dev->read_registers(ADS1115_RA_CONFIG, config, sizeof(config))) {
if (!_dev->read_registers(ADS1115_RA_CONFIG, config, ARRAY_SIZE(config))) {
error("_dev->read_registers failed in ADS1115");
return;
}
Expand Down

0 comments on commit 068e3b6

Please sign in to comment.