sGUI  V1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
log.c

Explains how to generate a log screen.

/*
* This example shows how to make a console log screen.
* The oldest log string will be deleted if there is not enough space on the
* screen for a new one.
*/
#include <stm32f4xx.h>
#include <stdio.h>
#include <lcd.h>
static __IO uint32_t TimingDelay;
void Delay(__IO uint32_t nTime) {
TimingDelay = nTime;
while (TimingDelay != 0);
}
void SysTick_Handler(void) {
if (TimingDelay) {
TimingDelay--;
}
}
int main(void) {
uint8_t i = 0;
char str[20];
if (SysTick_Config(SystemCoreClock / 1000)) {
while (1);
}
LCD_SetFont(&font_6x12);
for (;;) {
sprintf(str, "Log message %u", i++);
Delay(1000);
}
return 0;
}