File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1+ void puth (unsigned int i );
2+ void puts (const char * a );
3+
14void dac_init (void ) {
25 // no buffers required since we have an opamp
36 //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) {
1114 DAC -> DHR12R1 = value ;
1215 } else if (channel == 1 ) {
1316 DAC -> DHR12R2 = value ;
17+ } else {
18+ puts ("Failed to set DAC: invalid channel value: " );
19+ puth (value );
20+ puts ("\n" );
1421 }
1522}
1623
Original file line number Diff line number Diff line change @@ -304,7 +304,8 @@ void putch(const char a) {
304304
305305 //putc(&debug_ring, a);
306306 } else {
307- injectc (& debug_ring , a );
307+ // misra-c2012-17.7: serial debug function, ok to ignore output
308+ (void )injectc (& debug_ring , a );
308309 }
309310}
310311
You can’t perform that action at this time.
0 commit comments