cancel
Showing results for 
Search instead for 
Did you mean: 

Using lcd_log.c library function

DSEO
Associate II

Hi!!

I'm using lcd_log.c to debug on the LCD.

LCD_UsrLog ("This is Line% d \ n", i);

Is there a way to change the starting position of text output?

It always starts at the same location and scrolls down.

Please, help me!!

1 ACCEPTED SOLUTION

Accepted Solutions
AvaTar
Lead

If you talk about the SPL code for a F3 (like the F3 discovery), review the line-related functions in source file stm32303c_eval_lcd.c in folder ...Utilities/STM32_EVAL/STM32303C_EVAL.

View solution in original post

3 REPLIES 3
AvaTar
Lead

If you talk about the SPL code for a F3 (like the F3 discovery), review the line-related functions in source file stm32303c_eval_lcd.c in folder ...Utilities/STM32_EVAL/STM32303C_EVAL.

DSEO
Associate II

No, I file use in Utilities\Log\lcd_log.c..

file has 6 function below.

void LCD_LOG_Init(void);

void LCD_LOG_DeInit(void);

void LCD_LOG_SetHeader(uint8_t *Title);

void LCD_LOG_SetFooter(uint8_t *Status);

void LCD_LOG_ClearTextZone(void);

void LCD_LOG_UpdateDisplay (void);

And I tested function like below.

I want to change the location of the output text(This is Line..) , but I do not know where to fix it. (6 Function)

void Log_demo(void)

{

    uint8_t   i = 0;

    uint8_t   scroll_direction = 0;

    uint8_t   scroll_index = 0;

    /* Initialize LCD Log module */

    LCD_LOG_Init();

    /* Show Header and Footer texts */

    LCD_LOG_SetHeader((uint8_t *)"Test Debug LCD Monitor");

    LCD_LOG_SetFooter((uint8_t *)"");

    /* Output User logs */

    for (i = 0; i < 10; i++){

        LCD_UsrLog ("This is Line %d \n", i);

    }

//    HAL_Delay(500);

    /* Clear Old logs */

    LCD_LOG_ClearTextZone();

    /* Output new user logs */

    for (i = 0; i < 30; i++) {

        LCD_UsrLog ("This is Line %d \n", i);

    }

    /* Check for joystick user input for scroll (back and forward) */

    while (1)

    {

        if (scroll_direction == 0)

        {

            LCD_LOG_ScrollBack();

            scroll_index++;

            if (scroll_index > 30)

            {

                scroll_direction = 1;

            }

        }

        else

        {

            LCD_LOG_ScrollForward();

            scroll_index--;

            if (scroll_index == 0)

            {

                scroll_direction = 0;

            }

        }

        HAL_Delay (10);

    }

}

Oh I see!! thanks!!