Skip to content

Commit b502d06

Browse files
authored
Merge pull request #300 from pillo79/pr-unoq-warning-fixes
unoq: warning fixes
2 parents 9f5dc47 + 959de17 commit b502d06

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

loader/fixups.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ SYS_INIT(maybe_flash_bootloader, POST_KERNEL, CONFIG_FILE_SYSTEM_INIT_PRIORITY);
195195

196196
int analog_reference(uint8_t reference) {
197197
uint8_t init_status;
198+
198199
/* VREF+ is connected to VDDA by default */
199200
const struct gpio_dt_spec spec =
200201
GPIO_DT_SPEC_GET_BY_IDX(DT_PATH(zephyr_user), analog_switch_gpios, 0);
@@ -210,7 +211,7 @@ int analog_reference(uint8_t reference) {
210211
if (reference == AR_DEFAULT) {
211212
/* VREF+ is connected to VDDA */
212213
gpio_pin_set_dt(&spec, 0);
213-
return;
214+
return 0;
214215
}
215216

216217
gpio_pin_set_dt(&spec, 1);
@@ -236,7 +237,7 @@ int analog_reference(uint8_t reference) {
236237
}
237238

238239
HAL_SYSCFG_VREFBUF_VoltageScalingConfig(voltageScaling);
239-
HAL_SYSCFG_EnableVREFBUF();
240+
init_status = HAL_SYSCFG_EnableVREFBUF();
240241
HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE);
241242

242243
__ASSERT(init_status == HAL_OK, "ADC Conversion value may be incorrect");
@@ -248,7 +249,7 @@ EXPORT_SYMBOL(analog_reference);
248249

249250
int disable_vrefbuf() {
250251
// This is the safe HW configuration
251-
analog_reference(AR_DEFAULT);
252+
return analog_reference(AR_DEFAULT);
252253
}
253254

254255
SYS_INIT(disable_vrefbuf, POST_KERNEL, 0);

loader/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int loader(const struct shell *sh) {
168168
return -ENOMEM;
169169
}
170170
memset(ram_firmware, 0, 64 * 1024);
171-
*ram_start = &ram_firmware[0];
171+
*ram_start = (uint32_t)&ram_firmware[0];
172172
}
173173
if (gpio_pin_get_dt(&spec) == 0) {
174174
matrixBegin();

0 commit comments

Comments
 (0)