Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used)
parent
8ea01ff127
commit
190d604a0b
|
@ -1,3 +1,6 @@
|
|||
void puth(unsigned int i);
|
||||
void puts(const char *a);
|
||||
|
||||
void dac_init(void) {
|
||||
// no buffers required since we have an opamp
|
||||
//DAC->CR = DAC_CR_EN1 | DAC_CR_BOFF1 | DAC_CR_EN2 | DAC_CR_BOFF2;
|
||||
|
@ -11,6 +14,10 @@ void dac_set(int channel, uint32_t value) {
|
|||
DAC->DHR12R1 = value;
|
||||
} else if (channel == 1) {
|
||||
DAC->DHR12R2 = value;
|
||||
} else {
|
||||
puts("Failed to set DAC: invalid channel value: ");
|
||||
puth(value);
|
||||
puts("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -304,7 +304,8 @@ void putch(const char a) {
|
|||
|
||||
//putc(&debug_ring, a);
|
||||
} else {
|
||||
injectc(&debug_ring, a);
|
||||
// misra-c2012-17.7: serial debug function, ok to ignore output
|
||||
(void)injectc(&debug_ring, a);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue