Skip to content

Commit cc15f9d

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents 1e939d2 + 1b3bca1 commit cc15f9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/cxd56/common-hal/analogio/AnalogIn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) {
105105
}
106106

107107
uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
108-
uint16_t value = 0;
108+
int16_t value = 0;
109109

110110
read(analogin_dev[self->number].fd, &value, sizeof(value));
111111

112-
return value;
112+
return (uint16_t) 32768 + (uint16_t) value;
113113
}
114114

115115
// Reference voltage is a fixed value which is depending on the board.

0 commit comments

Comments
 (0)