Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used)

master
Riccardo 2019-07-07 22:07:14 -07:00
parent 8ea01ff127
commit 190d604a0b
2 changed files with 9 additions and 1 deletions

View File

@ -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");
}
}

View File

@ -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);
}
}