SPI.h compile error, error: 'g_ioport_ctrl' was not declared in this scope

Hi

I am developing a library, I am getting a SPI.h compile error.
The error:

  1. Only occurs on this library
  2. AND only for Uno R4 minima.
  3. All the other SPI libraries(one last week) I have written compile fine for Uno R4 Minima.

compile Error message is

Compiling library "SPI"

/home/gll/.arduino15/packages/arduino/hardware/renesas_uno/1.5.0/libraries/SPI/SPI.cpp: In static member function 'static std::tuple<bool, int, bool> arduino::ArduinoSPI::cfg_pins(int, int, int, int, uint8_t)':
/home/gll/.arduino15/packages/arduino/hardware/renesas_uno/1.5.0/libraries/SPI/SPI.cpp:378:22: error: 'g_ioport_ctrl' was not declared in this scope
R_IOPORT_PinCfg(&g_ioport_ctrl, g_pin_cfg[miso_pin].pin, (uint32_t) (IOPORT_CFG_PERIPHERAL_PIN | ioport_miso));

Anyone see this error before ?

Could you please post the code that generates this error using code tags?
I have used SPI in both the MINIMA and WIFI without issue.

The problem is something to do with file structure or includes.
It compiles, if have one header file in library.

My original structure was


The SPI.h include is in MAX7219plus.h
I removed all the TM* files and If I put common_data.h and seven_segment_font_data.h in MAX7219plus.h file , it compiles.
The Wprogram.h in diagram should read Arduino.h.

This only happens on R4 minima , no other board throws an error.

Hi

Ok i have working now to my satisfaction , I just combined common_data.h and seven_segment_font_data.h into a single file, and it complies.
common_data.h did not have a cpp file as it just a class with no methods.

I don't understand why that would cause SPI.h not to compile just for UNO R4 and the error message. about R_IOPORT_PinCfg or g_ioport_ctrl not declared.

regards