hey there! i have problems with leds(actually its pointers)
i have an empty global pointers (for example below)
volatile lv_obj_t *led_pointer;
i have init function that looks like
void lv_init_led(lv_obj_t * ledobj,lv_obj_t* par,lv_coord_t x,lv_coord_t y,lv_coord_t sizex,lv_coord_t sizey,char* text_to_the_left,lv_coord_t text_Y_offset)
{
ledobj = lv_led_create(par, NULL);
lv_obj_set_size(ledobj,sizex,sizey);
lv_obj_set_pos(ledobj,x,y);
lv_led_off(ledobj);
lv_obj_t * label1 = lv_label_create(par, NULL);
lv_obj_align(label1,ledobj,LV_LABEL_ALIGN_LEFT,text_Y_offset,0);
}
it was made for fast init of bunch of leds.
init sequence works fine, and i can even toggle led in it (in function)
but outside of this function i cant toggle led - program crashes with null-pointer error
Error: lv_led_on (lv_led.c #131 lv_led_on())
Error: NULL pointer (0x00000000) (lv_debug.c #127 lv_debug_log_error())
but the same works with buttons and labels and other objects.
What i am douing wrong?