I am Huy.
Currently, I am working with micropython on Linux. I am trying to build an LED module and an LCD module.
The content of LED and LCD files base on the BSP Discovery library. (https://github.com/STMicroelectronics/S ... -Discovery)
when i write the LED file to turn on the LED, the file is compiled and runnable.
however, when it comes to LCD module as i call BSP_LCD_Init() from stm32l4r9i_discovery_lcd.h. there are errors like below:
Screenshot from 2020-02-23 23-55-50.png
it is weird because while LED is written with the same method as LCD, LED can be compiled and run and LCD cannot.
the makefile of those 2 are below:
Code: Select all
USERMODULES_DIR := $(USERMOD_DIR)
# Add all C files to SRC_USERMOD.
SRC_USERMOD += $(USERMODULES_DIR)/simplefunction.c
CFLAGS_USERMOD += -I$(USERMODULES_DIR)
Code: Select all
#include "stm32l4r9i_discovery.h"
#include "stm32l4xx_hal.h"
void LED_init(int led)
{
if (led == 1)
{
BSP_LED_Init(LED1);
}
else
{
BSP_LED_Init(LED2);
}
}
void LED_on(int time)
{
BSP_LED_On(LED1);
HAL_Delay(time*1000);
BSP_LED_Off(LED1);
}
the code of LCD.c
Code: Select all
#include "stm32l4r9i_discovery_lcd.h"
#include "MyLCD.h"
void LCDinit(int color)
{
HAL_Init();
HAL_Delay(50);
BSP_LCD_Init();
uint32_t theColor;
if (color == 1)
{
theColor = 0xFFFF0000;
} else {
theColor = 0xFF00FFFF;
}
BSP_LCD_SetBackColor(theColor);
}