From: ChibiOS/os/hal/templates/hal_i2s_lld.h
you're needs to use ChibiOS\os\hal\ports\STM32\LLD\SPIv2\hal_i2s_lld.h
Sorry, the file I posted before was not the one I was using. I am using ChibiOS\os\hal\ports\STM32\LLD\SPIv2\hal_i2s_lld.h, but the problem I'm describing is still the same:
Trying to fit this from main.c :
static const I2SConfig i2sconfig = {
NULL, // TX Buffer //(1) tx pointer
rx_buffer, // RX Buffer //(2) rx pointer
AUDIO_BUFFER_LEN * 2, //(3) size_t
NULL, // tx callback //(4) tx pointer (this looks wrong)
i2s_end_callback, // i2s callback //(5) i2s_end_callback pointer
0, // i2scfgr //(6) int16
2 // i2spr //(7) int16
};
Into this: (original comments removed to make it easier to see the types)
ChibiOS\os\hal\ports\STM32\LLD\SPIv2\hal_i2s_lld.h
typedef struct {
const void *tx_buffer; //(1) tx pointer
void *rx_buffer; //(2) rx pointer
size_t size; //(3) size_t
i2scallback_t end_cb; //(4) i2scallback end_cb pointer
int16_t i2scfgr; //(5) i2scfgr int16
int16_t i2spr; //(6) i2spr int16
} I2SConfig;
It might work anyway. Or it might compile, but not be what was intended being stuffed in there. I haven't tried to analyze it much more than that. This is why I got the compiler error. There are 7 elements in the initializer, but the struct definition only has 6 elements. Am I missing something here?
Anyway, I'll leave it at that. I reverted all the changes I made from previous versions of the repository (when I first got the device). Everything from the current repository state compiles (I haven't tested an image this way yet) with gcc 7.xx, but not this error.