diff --git a/board/drivers/dac.h b/board/drivers/dac.h index 239f0fa79db276..ac565eb221cd05 100644 --- a/board/drivers/dac.h +++ b/board/drivers/dac.h @@ -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"); } } diff --git a/board/drivers/uart.h b/board/drivers/uart.h index 351e1f95114e34..5c5452483d0479 100644 --- a/board/drivers/uart.h +++ b/board/drivers/uart.h @@ -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); } }