-
Notifications
You must be signed in to change notification settings - Fork 3
Add VREF wrapper to BSP #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,13 +47,17 @@ adc_status_t adc_deinit(ADC_HandleTypeDef *h) { | |
| if (HAL_ADC_DeInit(h) != HAL_OK) return ADC_DEINIT_FAIL; | ||
|
|
||
| return ADC_OK; | ||
| } | ||
| } | ||
|
|
||
| uint32_t adc_get_vref(void) { | ||
| // this wasn't my doing | ||
| return ADC_CHANNEL_VREFINT; | ||
| } | ||
|
Comment on lines
+52
to
+55
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function uint32_t adc_get_vref(void) {
return 3300; // Return nominal VREF in mV
} |
||
|
|
||
| adc_status_t adc_read(ADC_HandleTypeDef *h, ADC_ChannelConfTypeDef* sConfig, QueueHandle_t q) { | ||
| if (sConfig == NULL || h == NULL || q == NULL) { | ||
| return ADC_CHANNEL_CONFIG_FAIL; | ||
| } | ||
| } | ||
|
|
||
| // BSP only configures channel ranks | ||
| #if defined(STM32F4xx) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The include path
"/opt/arm-toolchain/include"is an absolute path specific to a particular machine setup. This makes the workspace configuration non-portable for other contributors. Consider using environment variables or relative paths to ensure the project can be configured correctly on different systems.