-
Notifications
You must be signed in to change notification settings - Fork 2k
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
stm32: compiler errors in DAC #5543
Labels
Area: drivers
Area: Device drivers
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
State: duplicate
State: The issue/PR is a duplicate of another issue/PR
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Comments
OlegHahm
added
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
Area: drivers
Area: Device drivers
labels
Jun 11, 2016
A simple fix might be: diff --git a/cpu/stm32_common/periph/dac.c b/cpu/stm32_common/periph/dac.c
index d250802..79c6464 100644
--- a/cpu/stm32_common/periph/dac.c
+++ b/cpu/stm32_common/periph/dac.c
@@ -71,6 +71,10 @@ int8_t dac_init(dac_t line)
void dac_set(dac_t line, uint16_t value)
{
+#ifndef DAC_CONFIG
+ (void) line;
+ (void) value;
+#else
value = (value >> 4); /* scale to 12-bit */
#ifdef DAC_DHR12R2_DACC2DHR
if (dac_config[line].chan) {
@@ -84,11 +88,16 @@ void dac_set(dac_t line, uint16_t value)
_DAC(line)->DHR12R1 = value;
#endif
+#endif
}
void dac_poweron(dac_t line)
{
+#ifndef DAC_CONFIG
+ (void) line;
+#else
DAC->CR |= (1 << (16 * dac_config[line].chan));
+#endif
} |
Duplicate / subpart of #5519 |
miri64
added
the
State: duplicate
State: The issue/PR is a duplicate of another issue/PR
label
Jun 12, 2016
Ups, overlooked this one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: drivers
Area: Device drivers
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
State: duplicate
State: The issue/PR is a duplicate of another issue/PR
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Trying to compile any application for iotlab-m3 on current master results in:
I assume that the cause for this error exists for some time, but shows only now because of an update gcc:
The text was updated successfully, but these errors were encountered: