Skip to content

Commit fba3696

Browse files
committed
Fix styling and fix mbed_lib.json syntax error
1 parent 79056e9 commit fba3696

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

drivers/mbed_lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
},
4545
"default-adc-vref": {
4646
"help": "Default reference voltage for ADC (float)",
47-
"value": 3.3f
47+
"value": "3.3f"
48+
}
4849
}
4950
}

drivers/source/AnalogIn.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,18 @@ unsigned short AnalogIn::read_u16()
5454
return ret;
5555
}
5656

57-
float AnalogIn::read_volts() {
58-
float ret = this->read();
59-
return (ret*this->vref);
57+
float AnalogIn::read_volts()
58+
{
59+
return (this->read() * this->vref);
6060
}
6161

62-
void AnalogIn::set_reference_voltage(float vref) {
62+
void AnalogIn::set_reference_voltage(float vref)
63+
{
6364
this->vref = vref;
6465
}
6566

66-
float AnalogIn::get_reference_voltage(void) {
67+
float AnalogIn::get_reference_voltage(void)
68+
{
6769
return this->vref;
6870
}
6971

0 commit comments

Comments
 (0)