shuichitakano / pico_lib

pico でなにか作る時のいろいろ
MIT License
8 stars 2 forks source link

Add <cstdio> header for file dma.h #9

Closed fhoedemakers closed 3 months ago

fhoedemakers commented 3 months ago

Hi,

I upgraded my dev environment to Ubuntu 24.04 LTS. This comes whith arm-none-eabi-gcc 13.2.1.

When building pico_lib i noticed there is a compiler error in pico_lib/dvi/dma.cpp, which did not occur in previous versions of gcc:

/home/frank/projects/public/pico-infones/pico_lib/dvi/dma.cpp: In constructor 'dvi::DMA::DMA(const dvi::Timing&, PIO)': /home/frank/projects/public/pico-infones/pico_lib/dvi/dma.cpp:57:13: error: 'printf' was not declared in this scope 57 | printf("lane %d: DMA ch ctrl %d, ch data %d, FIFO %p, dreq %d\n", i, cfg.chCtrl, cfg.chData, cfg.txFIFO, cfg.dreq); | ^~ /home/frank/projects/public/pico-infones/pico_lib/dvi/dma.cpp:7:1: note: 'printf' is defined in header ''; did you forget to '#include '?

So i added

include to pico_lib/dvi/dma.h

which solved the error.

Best regards,

Frank

shuichitakano commented 3 months ago

Thank you for pointing that out. It seems I missed the include. This happens to me often. However, I would prefer if the include is added to the cpp file instead of the header file. Could you please make that change?

fhoedemakers commented 3 months ago

Hi,

No problem. I now moved the the include to dma.cpp.

Best regards,

Frank