http://www.chibios.org/dokuwiki/doku.ph ... overy_code
Which I have slightly modified to the below,
Code: Select all
/*
* PWM configuration structure.
* Cyclic callback enabled, channels 1 and 4 enabled without callbacks,
* the active state is a logic one.
* referenced code found here http://www.chibios.org/dokuwiki/doku.php?id=chibios:articles:stm32f4_discovery_code
*/
static PWMConfig pwmcfg = {
8000000, // 8MHz PWM clock frequency.
400, // PWM period in ticks 20KHz
NULL,
{
{PWM_OUTPUT_ACTIVE_HIGH, NULL},// PWM CH1
{PWM_OUTPUT_ACTIVE_HIGH, NULL},// PWM CH2
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL}
},
/* HW dependent part.*/
0
};I get "Description Resource Path Location Type missing initializer for field 'dier' of 'PWMConfig' [-Wmissing-field-initializers] main.c" as shown below.
Are there any suggestions on how to do this properly, such that it doesn't generate this warning? From what I'm seen on the interwebs, it appears I need to initialize it differently, but I don't know how. Here's my compiler line, which includes -Wall -Wextra.
Code: Select all
arm-none-eabi-gcc -c -ggdb -O0 -g3 -mcpu=cortex-m4 -falign-functions=16 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -fomit-frame-pointer -Wall -Wextra -Wstrict-prototypes -fverbose-asm -MMD -MP -MF .build/dep/fakethumbfile.o.d -I. -Iugfx -Iugfx/3rdparty/tinygl-0.4-ugfx/include -Iugfx/boards/base/STM32F429i-Discovery -Iugfx/drivers/gdisp/STM32LTDC -Ichibios_3.0.1/os/common/ports/ARMCMx/devices/STM32F4xx -Ichibios_3.0.1/os/ext/CMSIS/include -Ichibios_3.0.1/os/ext/CMSIS/ST -Ichibios_3.0.1/os/rt/include -Ichibios_3.0.1/os/rt/ports/ARMCMx -Ichibios_3.0.1/os/rt/ports/ARMCMx/compilers/GCC -Ichibios_3.0.1/os/hal/osal/rt -Ichibios_3.0.1/os/hal/include -Ichibios_3.0.1/os/hal/ports/common/ARMCMx -Ichibios_3.0.1/os/hal/ports/STM32/STM32F4xx -Ichibios_3.0.1/os/hal/ports/STM32/LLD -Ichibios_3.0.1/os/hal/ports/STM32/LLD/DACv1 -Ichibios_3.0.1/os/hal/ports/STM32/LLD/GPIOv2 -Ichibios_3.0.1/os/hal/ports/STM32/LLD/I2Cv1 -Ichibios_3.0.1/os/hal/ports/STM32/LLD/OTGv1 -Ichibios_3.0.1/os/hal/ports/STM32/LLD/RTCv2 -Ichibios_3.0.1/os/hal/ports/STM32/LLD/SPIv1 -Ichibios_3.0.1/os/hal/ports/STM32/LLD/TIMv1 -Ichibios_3.0.1/os/hal/ports/STM32/LLD/USARTv1 -Ichibios_3.0.1/os/hal/ports/STM32/LLD/FSMCv1 -Ichibios_3.0.1/os/hal/boards/ST_STM32F429I_DISCOVERY -Ichibios_3.0.1/os/hal/lib/streams/ -Ichibios_3.0.1/os/various -DGFX_USE_OS_CHIBIOS=TRUE -DGFX_USE_OS_CHIBIOS=TRUE -DCORTEX_USE_FPU=TRUE -DUSE_FPU=hard -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB fakethumbfile.c -o .build/obj/fakethumbfile.o