Skip to content

Commit

Permalink
Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void o…
Browse files Browse the repository at this point in the history
…utput must be used)
  • Loading branch information
rbiasini committed Jul 8, 2019
1 parent 8ea01ff commit 190d604
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions board/drivers/dac.h
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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");
}
}

3 changes: 2 additions & 1 deletion board/drivers/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 190d604

Please sign in to comment.