ArduCAM / RaspberryPi

This is Arducam camera demos used on Raspberry Pi paltform
BSD 3-Clause "New" or "Revised" License
169 stars 97 forks source link

rpi4 spi cam with ov5642 not compilable. #96

Closed KwangSon closed 1 year ago

KwangSon commented 1 year ago

Hi, I'm not sure but is there anyone manage code under RaspberryPi/SPI_Camera? It's seem abandoned long time not even compilable.

even type sudo make it complain about

src/ArduCAM.h:345:27: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token
  345 |     unsigned int errCount = 0;
      |                           ^
src/ArduCAM.h:351:1: error: unknown type name ‘class’
  351 | class ArduCAM{
      | ^~~~~
src/ArduCAM.h:351:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
  351 | class ArduCAM{
      |              ^
src/ArducamDemo.c: In function ‘main’:
src/ArducamDemo.c:42:3: warning: implicit declaration of function ‘ArduCAM_CS_init’ [-Wimplicit-function-declaration]
   42 |   ArduCAM_CS_init( CAM_CS1, -1, -1, -1 );   // init the cs
      |   ^~~~~~~~~~~~~~~
...

which is in make file needs to be gcc -> g++ and ArduCAM_CS_init is not defined... (only ArduCAM_CS_init(void);)

please someone manage code. it's really basic.

XiaoJun9 commented 1 year ago

Hi, I was just running it on a Pi4 with OS "bullseye". I got similar results:

:~/RaspberryPi/SPI_Camera $ sudo make
gcc -c -o obj/ArducamDemo.o src/ArducamDemo.c -Wall -pthread
In file included from src/ArducamDemo.c:3:
src/ArduCAM.h:345:27: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token
  345 |     unsigned int errCount = 0;
      |                           ^
src/ArduCAM.h:351:1: error: unknown type name ‘class’
  351 | class ArduCAM{
      | ^~~~~
src/ArduCAM.h:351:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
  351 | class ArduCAM{
      |              ^
src/ArducamDemo.c: In function ‘main’:
src/ArducamDemo.c:42:3: warning: implicit declaration of function ‘ArduCAM_CS_init’ [-Wimplicit-function-declaration]
   42 |   ArduCAM_CS_init( CAM_CS1, -1, -1, -1 );   // init the cs
      |   ^~~~~~~~~~~~~~~
src/ArducamDemo.c:48:3: warning: implicit declaration of function ‘Arducam_bus_detect’ [-Wimplicit-function-declaration]
   48 |   Arducam_bus_detect( CAM_CS1, -1, -1, -1 );
      |   ^~~~~~~~~~~~~~~~~~
src/ArducamDemo.c:50:3: warning: implicit declaration of function ‘resetFirmware’ [-Wimplicit-function-declaration]
   50 |   resetFirmware( CAM_CS1, -1, -1, -1 );  //reset the firmware
      |   ^~~~~~~~~~~~~
src/ArducamDemo.c:52:3: warning: implicit declaration of function ‘ArduCAM_Init’ [-Wimplicit-function-declaration]
   52 |   ArduCAM_Init(sensor_model);
      |   ^~~~~~~~~~~~
src/ArducamDemo.c:52:16: error: ‘sensor_model’ undeclared (first use in this function); did you mean ‘sensor_reg’?
   52 |   ArduCAM_Init(sensor_model);

What can be done? Thanks in advance for your support. Kind regards!