提交 4820dbb0 编写于 作者: O ousugo

Merge branch 'master' into addAnnotation

......@@ -77,6 +77,7 @@ RT-Thread supports many architectures, and has covered the major architectures i
- **ARM Cortex-M4**:manufacturers like ST、Nuvton、NXP、GigaDevice、Realtek、Ambiq Micro, ect.
- **ARM Cortex-M7**:manufacturers like ST、NXP
- **ARM Cortex-M23**:manufacturers like GigaDevice
- **ARM Cortex-M33**:manufacturers like ST
- **ARM Cortex-R4**
- **ARM Cortex-A8/A9**:manufacturers like NXP
- **ARM7**:manufacturers like Samsung
......
......@@ -68,35 +68,21 @@ Env 是RT-Thread推出的开发辅助工具,针对基于RT-Thread操作系统
RT-Thread RTOS 支持许多架构,并且已经涵盖了当前应用中的主要架构。涉及的架构和芯片制造商有:
- ARM Cortex-M0/M0+:如芯片制造商 ST
- ARM Cortex-M3:如芯片制造商 ST、全志、灵动等.
- ARM Cortex-M4:如芯片制造商 ST、Nuvton、NXP、GigaDevice、Realtek、Ambiq Micro等
- ARM Cortex-M7:如芯片制造商 ST、NXP
- ARM Cortex-M23:如芯片制造商 GigaDevice
- ARM Cortex-M33:如芯片制造商 ST
- ARM Cortex-R4
- ARM Cortex-A8/A9:如芯片制造商 NXP
- ARM7:如芯片制造商Samsung
- ARM9:如芯片制造商Allwinner、Xilinx 、GOKE
- ARM11:如芯片制造商Fullhan
- MIPS32:如芯片制造商loongson、Ingenic
- RISC-V:如芯片制造商Hifive、Kendryte、[芯来Nuclei](https://nucleisys.com/)
- ARC:如芯片制造商SYNOPSYS
- DSP:如芯片制造商 TI
- C-Sky
- x86
......
......@@ -7,6 +7,7 @@
# RT-Thread Kernel
#
CONFIG_RT_NAME_MAX=10
# CONFIG_RT_USING_BIG_ENDIAN is not set
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
# CONFIG_RT_USING_SMP is not set
CONFIG_RT_ALIGN_SIZE=8
......@@ -19,7 +20,7 @@ CONFIG_RT_USING_OVERFLOW_CHECK=y
CONFIG_RT_USING_HOOK=y
CONFIG_RT_USING_IDLE_HOOK=y
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
CONFIG_IDLE_THREAD_STACK_SIZE=1024
CONFIG_IDLE_THREAD_STACK_SIZE=8192
# CONFIG_RT_USING_TIMER_SOFT is not set
#
......@@ -28,6 +29,9 @@ CONFIG_IDLE_THREAD_STACK_SIZE=1024
# CONFIG_RT_KSERVICE_USING_STDLIB is not set
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
# CONFIG_RT_USING_ASM_MEMCPY is not set
# CONFIG_RT_USING_ASM_MEMSET is not set
# CONFIG_RT_USING_TINY_FFS is not set
# CONFIG_RT_PRINTF_LONGLONG is not set
CONFIG_RT_DEBUG=y
CONFIG_RT_DEBUG_COLOR=y
# CONFIG_RT_DEBUG_INIT_CONFIG is not set
......@@ -73,8 +77,7 @@ CONFIG_RT_USING_INTERRUPT_INFO=y
CONFIG_RT_USING_CONSOLE=y
CONFIG_RT_CONSOLEBUF_SIZE=128
CONFIG_RT_CONSOLE_DEVICE_NAME="uart2"
# CONFIG_RT_PRINTF_LONGLONG is not set
CONFIG_RT_VER_NUM=0x40004
CONFIG_RT_VER_NUM=0x40100
# CONFIG_RT_USING_CPU_FFS is not set
# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
......@@ -83,8 +86,9 @@ CONFIG_RT_VER_NUM=0x40004
#
CONFIG_RT_USING_COMPONENTS_INIT=y
CONFIG_RT_USING_USER_MAIN=y
CONFIG_RT_MAIN_THREAD_STACK_SIZE=2048
CONFIG_RT_MAIN_THREAD_STACK_SIZE=8192
CONFIG_RT_MAIN_THREAD_PRIORITY=10
# CONFIG_RT_USING_LEGACY is not set
#
# C++ features
......@@ -99,7 +103,7 @@ CONFIG_RT_USING_MSH=y
CONFIG_FINSH_USING_MSH=y
CONFIG_FINSH_THREAD_NAME="tshell"
CONFIG_FINSH_THREAD_PRIORITY=20
CONFIG_FINSH_THREAD_STACK_SIZE=4096
CONFIG_FINSH_THREAD_STACK_SIZE=8192
CONFIG_FINSH_USING_HISTORY=y
CONFIG_FINSH_HISTORY_LINES=5
CONFIG_FINSH_USING_SYMTAB=y
......@@ -114,6 +118,7 @@ CONFIG_FINSH_ARG_MAX=10
# Device virtual file system
#
CONFIG_RT_USING_DFS=y
CONFIG_DFS_USING_POSIX=y
CONFIG_DFS_USING_WORKDIR=y
CONFIG_DFS_FILESYSTEMS_MAX=2
CONFIG_DFS_FILESYSTEM_TYPES_MAX=2
......@@ -141,6 +146,7 @@ CONFIG_RT_DFS_ELM_DRIVES=2
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512
# CONFIG_RT_DFS_ELM_USE_ERASE is not set
CONFIG_RT_DFS_ELM_REENTRANT=y
CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_ROMFS is not set
# CONFIG_RT_USING_DFS_RAMFS is not set
......@@ -193,6 +199,7 @@ CONFIG_RT_USING_SPI_MSD=y
#
# Using USB
#
# CONFIG_RT_USING_USB is not set
# CONFIG_RT_USING_USB_HOST is not set
# CONFIG_RT_USING_USB_DEVICE is not set
......@@ -200,16 +207,20 @@ CONFIG_RT_USING_SPI_MSD=y
# POSIX layer and C standard library
#
CONFIG_RT_USING_LIBC=y
CONFIG_RT_USING_PTHREADS=y
CONFIG_PTHREAD_NUM_MAX=8
CONFIG_RT_USING_POSIX=y
# CONFIG_RT_USING_POSIX_MMAP is not set
# CONFIG_RT_USING_POSIX_TERMIOS is not set
# CONFIG_RT_USING_POSIX_GETLINE is not set
# CONFIG_RT_USING_POSIX_AIO is not set
CONFIG_RT_LIBC_USING_TIME=y
# CONFIG_RT_LIBC_USING_FILEIO is not set
# CONFIG_RT_USING_MODULE is not set
CONFIG_RT_LIBC_DEFAULT_TIMEZONE=8
#
# POSIX (Portable Operating System Interface) layer
#
# CONFIG_RT_USING_POSIX_FS is not set
# CONFIG_RT_USING_POSIX_DELAY is not set
# CONFIG_RT_USING_POSIX_GETLINE is not set
CONFIG_RT_USING_PTHREADS=y
CONFIG_PTHREAD_NUM_MAX=8
#
# Network
#
......@@ -262,11 +273,11 @@ CONFIG_RT_LWIP_TCP_SND_BUF=4096
CONFIG_RT_LWIP_TCP_WND=2048
CONFIG_RT_LWIP_TCPTHREAD_PRIORITY=12
CONFIG_RT_LWIP_TCPTHREAD_MBOX_SIZE=8
CONFIG_RT_LWIP_TCPTHREAD_STACKSIZE=4096
CONFIG_RT_LWIP_TCPTHREAD_STACKSIZE=8192
# CONFIG_LWIP_NO_RX_THREAD is not set
# CONFIG_LWIP_NO_TX_THREAD is not set
CONFIG_RT_LWIP_ETHTHREAD_PRIORITY=14
CONFIG_RT_LWIP_ETHTHREAD_STACKSIZE=512
CONFIG_RT_LWIP_ETHTHREAD_STACKSIZE=8192
CONFIG_RT_LWIP_ETHTHREAD_MBOX_SIZE=8
# CONFIG_RT_LWIP_REASSEMBLY_FRAG is not set
CONFIG_LWIP_NETIF_STATUS_CALLBACK=1
......@@ -300,6 +311,7 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_RT_USING_RYM is not set
# CONFIG_RT_USING_ULOG is not set
# CONFIG_RT_USING_UTEST is not set
# CONFIG_RT_USING_VAR_EXPORT is not set
# CONFIG_RT_USING_RT_LINK is not set
#
......@@ -401,12 +413,17 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_AGILE_FTP is not set
# CONFIG_PKG_USING_EMBEDDEDPROTO is not set
# CONFIG_PKG_USING_RT_LINK_HW is not set
# CONFIG_PKG_USING_LORA_PKT_FWD is not set
# CONFIG_PKG_USING_LORA_GW_DRIVER_LIB is not set
# CONFIG_PKG_USING_LORA_PKT_SNIFFER is not set
# CONFIG_PKG_USING_HM is not set
# CONFIG_PKG_USING_SMALL_MODBUS is not set
#
# security packages
#
# CONFIG_PKG_USING_MBEDTLS is not set
# CONFIG_PKG_USING_libsodium is not set
# CONFIG_PKG_USING_LIBSODIUM is not set
# CONFIG_PKG_USING_TINYCRYPT is not set
# CONFIG_PKG_USING_TFM is not set
# CONFIG_PKG_USING_YD_CRYPTO is not set
......@@ -422,6 +439,18 @@ CONFIG_RT_LWIP_USING_PING=y
#
# multimedia packages
#
#
# LVGL: powerful and easy-to-use embedded GUI library
#
# CONFIG_PKG_USING_LVGL is not set
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
#
# u8g2: a monochrome graphic library
#
# CONFIG_PKG_USING_U8G2_OFFICIAL is not set
# CONFIG_PKG_USING_U8G2 is not set
# CONFIG_PKG_USING_OPENMV is not set
# CONFIG_PKG_USING_MUPDF is not set
# CONFIG_PKG_USING_STEMWIN is not set
......@@ -434,6 +463,13 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_NUEMWIN is not set
# CONFIG_PKG_USING_MP3PLAYER is not set
# CONFIG_PKG_USING_TINYJPEG is not set
# CONFIG_PKG_USING_UGUI is not set
#
# PainterEngine: A cross-platform graphics application framework written in C language
#
# CONFIG_PKG_USING_PAINTERENGINE is not set
# CONFIG_PKG_USING_PAINTERENGINE_AUX is not set
#
# tools packages
......@@ -476,19 +512,33 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_MEM_SANDBOX is not set
# CONFIG_PKG_USING_SOLAR_TERMS is not set
# CONFIG_PKG_USING_GAN_ZHI is not set
# CONFIG_PKG_USING_FDT is not set
#
# system packages
#
#
# acceleration: Assembly language or algorithmic acceleration packages
# enhanced kernel services
#
# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
# CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set
# CONFIG_PKG_USING_RT_VSNPRINTF_FULL is not set
#
# acceleration: Assembly language or algorithmic acceleration packages
#
# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set
# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set
# CONFIG_PKG_USING_QFPLIB_M3 is not set
#
# CMSIS: ARM Cortex-M Microcontroller Software Interface Standard
#
# CONFIG_PKG_USING_CMSIS_5 is not set
# CONFIG_PKG_USING_CMSIS_5_AUX is not set
# CONFIG_PKG_USING_CMSIS_RTOS2 is not set
#
# Micrium: Micrium software products porting for RT-Thread
#
......@@ -506,8 +556,6 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_FLASHDB is not set
# CONFIG_PKG_USING_SQLITE is not set
# CONFIG_PKG_USING_RTI is not set
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
# CONFIG_PKG_USING_CMSIS is not set
# CONFIG_PKG_USING_DFS_YAFFS is not set
# CONFIG_PKG_USING_LITTLEFS is not set
# CONFIG_PKG_USING_DFS_JFFS2 is not set
......@@ -524,13 +572,14 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_QBOOT is not set
# CONFIG_PKG_USING_PPOOL is not set
# CONFIG_PKG_USING_OPENAMP is not set
# CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set
# CONFIG_PKG_USING_LPM is not set
# CONFIG_PKG_USING_TLSF is not set
# CONFIG_PKG_USING_EVENT_RECORDER is not set
# CONFIG_PKG_USING_ARM_2D is not set
# CONFIG_PKG_USING_WCWIDTH is not set
# CONFIG_PKG_USING_MCUBOOT is not set
# CONFIG_PKG_USING_TINYUSB is not set
# CONFIG_PKG_USING_USB_STACK is not set
#
# peripheral libraries and drivers
......@@ -542,7 +591,6 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_AS7341 is not set
# CONFIG_PKG_USING_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set
# CONFIG_PKG_USING_U8G2 is not set
# CONFIG_PKG_USING_BUTTON is not set
# CONFIG_PKG_USING_PCF8574 is not set
# CONFIG_PKG_USING_SX12XX is not set
......@@ -604,6 +652,10 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_MCP23008 is not set
# CONFIG_PKG_USING_BLUETRUM_SDK is not set
# CONFIG_PKG_USING_MISAKA_AT24CXX is not set
# CONFIG_PKG_USING_MISAKA_RGB_BLING is not set
# CONFIG_PKG_USING_BL_MCU_SDK is not set
# CONFIG_PKG_USING_SOFT_SERIAL is not set
# CONFIG_PKG_USING_MB85RS16 is not set
#
# AI packages
......@@ -671,7 +723,6 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_MCURSES is not set
# CONFIG_PKG_USING_COWSAY is not set
# CONFIG_PKG_USING_TERMBOX is not set
CONFIG_SOC_LS=y
CONFIG_SOC_LS1C300=y
CONFIG_RT_LS1C_OPENLOONGSON=y
# CONFIG_RT_LS1C_BAICAIBOARD is not set
......
......@@ -15,7 +15,7 @@
#define RT_USING_HOOK
#define RT_USING_IDLE_HOOK
#define RT_IDLE_HOOK_LIST_SIZE 4
#define IDLE_THREAD_STACK_SIZE 1024
#define IDLE_THREAD_STACK_SIZE 8192
/* kservice optimization */
......@@ -44,13 +44,13 @@
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart2"
#define RT_VER_NUM 0x40004
#define RT_VER_NUM 0x40100
/* RT-Thread Components */
#define RT_USING_COMPONENTS_INIT
#define RT_USING_USER_MAIN
#define RT_MAIN_THREAD_STACK_SIZE 2048
#define RT_MAIN_THREAD_STACK_SIZE 8192
#define RT_MAIN_THREAD_PRIORITY 10
/* C++ features */
......@@ -63,7 +63,7 @@
#define FINSH_USING_MSH
#define FINSH_THREAD_NAME "tshell"
#define FINSH_THREAD_PRIORITY 20
#define FINSH_THREAD_STACK_SIZE 4096
#define FINSH_THREAD_STACK_SIZE 8192
#define FINSH_USING_HISTORY
#define FINSH_HISTORY_LINES 5
#define FINSH_USING_SYMTAB
......@@ -75,6 +75,7 @@
/* Device virtual file system */
#define RT_USING_DFS
#define DFS_USING_POSIX
#define DFS_USING_WORKDIR
#define DFS_FILESYSTEMS_MAX 2
#define DFS_FILESYSTEM_TYPES_MAX 2
......@@ -93,6 +94,7 @@
#define RT_DFS_ELM_DRIVES 2
#define RT_DFS_ELM_MAX_SECTOR_SIZE 512
#define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000
#define RT_USING_DFS_DEVFS
/* Device Drivers */
......@@ -116,10 +118,13 @@
/* POSIX layer and C standard library */
#define RT_USING_LIBC
#define RT_LIBC_USING_TIME
#define RT_LIBC_DEFAULT_TIMEZONE 8
/* POSIX (Portable Operating System Interface) layer */
#define RT_USING_PTHREADS
#define PTHREAD_NUM_MAX 8
#define RT_USING_POSIX
#define RT_LIBC_DEFAULT_TIMEZONE 8
/* Network */
......@@ -160,9 +165,9 @@
#define RT_LWIP_TCP_WND 2048
#define RT_LWIP_TCPTHREAD_PRIORITY 12
#define RT_LWIP_TCPTHREAD_MBOX_SIZE 8
#define RT_LWIP_TCPTHREAD_STACKSIZE 4096
#define RT_LWIP_TCPTHREAD_STACKSIZE 8192
#define RT_LWIP_ETHTHREAD_PRIORITY 14
#define RT_LWIP_ETHTHREAD_STACKSIZE 512
#define RT_LWIP_ETHTHREAD_STACKSIZE 8192
#define RT_LWIP_ETHTHREAD_MBOX_SIZE 8
#define LWIP_NETIF_STATUS_CALLBACK 1
#define LWIP_NETIF_LINK_CALLBACK 1
......@@ -213,15 +218,29 @@
/* multimedia packages */
/* LVGL: powerful and easy-to-use embedded GUI library */
/* u8g2: a monochrome graphic library */
/* PainterEngine: A cross-platform graphics application framework written in C language */
/* tools packages */
/* system packages */
/* enhanced kernel services */
/* acceleration: Assembly language or algorithmic acceleration packages */
/* CMSIS: ARM Cortex-M Microcontroller Software Interface Standard */
/* Micrium: Micrium software products porting for RT-Thread */
......@@ -238,7 +257,6 @@
/* entertainment: terminal games and other interesting software packages */
#define SOC_LS
#define SOC_LS1C300
#define RT_LS1C_OPENLOONGSON
#define RT_USING_UART2
......
......@@ -10,14 +10,15 @@ src = Split("""
""")
src += ['drv_common.c']
src += ['drv_clk.c']
if GetDepend(['RT_USING_PIN']):
if GetDepend(['BSP_USING_GPIO']):
src += ['drv_gpio.c']
if GetDepend(['RT_USING_WDT']):
if GetDepend(['BSP_USING_UART']):
src += ['drv_wdt.c']
if GetDepend(['RT_USING_SERIAL']):
if GetDepend(['BSP_USING_UART']):
src += ['drv_usart.c']
if GetDepend(['BSP_USING_PWM']):
......
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-08-20 breo.com first version
*/
#include "drv_clk.h"
#include "board.h"
void DumpClock(const char *msg)
{
RCC_ClocksType RCC_ClockFreq;
rt_kprintf("--------------------------------\n");
rt_kprintf("%s:\n", msg);
RCC_GetClocksFreqValue(&RCC_ClockFreq);
rt_kprintf("SYSCLK: %d\n", RCC_ClockFreq.SysclkFreq);
rt_kprintf("HCLK: %d\n", RCC_ClockFreq.HclkFreq);
rt_kprintf("PCLK1: %d\n", RCC_ClockFreq.Pclk1Freq);
rt_kprintf("PCLK2: %d\n", RCC_ClockFreq.Pclk2Freq);
}
void SetSysClockToHSI(void)
{
RCC_DeInit();
RCC_EnableHsi(ENABLE);
/* Enable Prefetch Buffer */
FLASH_PrefetchBufSet(FLASH_PrefetchBuf_EN);
/* Flash 0 wait state */
FLASH_SetLatency(FLASH_LATENCY_0);
/* HCLK = SYSCLK */
RCC_ConfigHclk(RCC_SYSCLK_DIV1);
/* PCLK2 = HCLK */
RCC_ConfigPclk2(RCC_HCLK_DIV1);
/* PCLK1 = HCLK */
RCC_ConfigPclk1(RCC_HCLK_DIV1);
/* Select HSE as system clock source */
RCC_ConfigSysclk(RCC_SYSCLK_SRC_HSI);
/* Wait till PLL is used as system clock source */
while (RCC_GetSysclkSrc() != 0x00)
{
}
}
/**
* @brief Selects HSE as System clock source and configure HCLK, PCLK2
* and PCLK1 prescalers.
*/
void SetSysClockToHSE(void)
{
ErrorStatus HSEStartUpStatus;
/* SYSCLK, HCLK, PCLK2 and PCLK1 configuration
* -----------------------------*/
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_ConfigHse(RCC_HSE_ENABLE);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitHseStable();
if (HSEStartUpStatus == SUCCESS)
{
/* Enable Prefetch Buffer */
FLASH_PrefetchBufSet(FLASH_PrefetchBuf_EN);
if (HSE_Value <= 32000000)
{
/* Flash 0 wait state */
FLASH_SetLatency(FLASH_LATENCY_0);
}
else
{
/* Flash 1 wait state */
FLASH_SetLatency(FLASH_LATENCY_1);
}
/* HCLK = SYSCLK */
RCC_ConfigHclk(RCC_SYSCLK_DIV1);
/* PCLK2 = HCLK */
RCC_ConfigPclk2(RCC_HCLK_DIV1);
/* PCLK1 = HCLK */
RCC_ConfigPclk1(RCC_HCLK_DIV1);
/* Select HSE as system clock source */
RCC_ConfigSysclk(RCC_SYSCLK_SRC_HSE);
/* Wait till HSE is used as system clock source */
while (RCC_GetSysclkSrc() != 0x04)
{
}
}
else
{
/* If HSE fails to start-up, the application will have wrong clock
configuration. User can add here some code to deal with this error */
/* Go to infinite loop */
while (1)
{
}
}
}
void SetSysClockToPLL(uint32_t freq, uint8_t src)
{
uint32_t pllsrc = (src == SYSCLK_PLLSRC_HSI ? RCC_PLL_SRC_HSI_DIV2 : RCC_PLL_SRC_HSE_DIV2);
uint32_t pllmul;
uint32_t latency;
uint32_t pclk1div, pclk2div;
ErrorStatus HSEStartUpStatus;
if (HSE_VALUE != 8000000)
{
/* HSE_VALUE == 8000000 is needed in this project! */
while (1)
;
}
/* SYSCLK, HCLK, PCLK2 and PCLK1 configuration
* -----------------------------*/
/* RCC system reset(for debug purpose) */
RCC_DeInit();
if (src == SYSCLK_PLLSRC_HSE)
{
/* Enable HSE */
RCC_ConfigHse(RCC_HSE_ENABLE);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitHseStable();
if (HSEStartUpStatus != SUCCESS)
{
/* If HSE fails to start-up, the application will have wrong clock
configuration. User can add here some code to deal with this
error */
/* Go to infinite loop */
while (1)
;
}
}
switch (freq)
{
case 24000000:
latency = FLASH_LATENCY_0;
pllmul = RCC_PLL_MUL_6;
pclk1div = RCC_HCLK_DIV1;
pclk2div = RCC_HCLK_DIV1;
break;
case 36000000:
latency = FLASH_LATENCY_1;
pllmul = RCC_PLL_MUL_9;
pclk1div = RCC_HCLK_DIV1;
pclk2div = RCC_HCLK_DIV1;
break;
case 48000000:
latency = FLASH_LATENCY_1;
pllmul = RCC_PLL_MUL_12;
pclk1div = RCC_HCLK_DIV2;
pclk2div = RCC_HCLK_DIV1;
break;
case 56000000:
latency = FLASH_LATENCY_1;
pllmul = RCC_PLL_MUL_14;
pclk1div = RCC_HCLK_DIV2;
pclk2div = RCC_HCLK_DIV1;
break;
case 72000000:
latency = FLASH_LATENCY_2;
pllmul = RCC_PLL_MUL_18;
pclk1div = RCC_HCLK_DIV2;
pclk2div = RCC_HCLK_DIV1;
break;
case 96000000:
latency = FLASH_LATENCY_2;
pllmul = RCC_PLL_MUL_24;
pclk1div = RCC_HCLK_DIV4;
pclk2div = RCC_HCLK_DIV2;
break;
case 128000000:
latency = FLASH_LATENCY_3;
pllmul = RCC_PLL_MUL_32;
pclk1div = RCC_HCLK_DIV4;
pclk2div = RCC_HCLK_DIV2;
break;
case 144000000:
/* must use HSE as PLL source */
latency = FLASH_LATENCY_4;
pllsrc = RCC_PLL_SRC_HSE_DIV1;
pllmul = RCC_PLL_MUL_18;
pclk1div = RCC_HCLK_DIV4;
pclk2div = RCC_HCLK_DIV2;
break;
default:
while (1)
;
}
FLASH_SetLatency(latency);
/* HCLK = SYSCLK */
RCC_ConfigHclk(RCC_SYSCLK_DIV1);
/* PCLK2 = HCLK */
RCC_ConfigPclk2(pclk2div);
/* PCLK1 = HCLK */
RCC_ConfigPclk1(pclk1div);
RCC_ConfigPll(pllsrc, pllmul);
/* Enable PLL */
RCC_EnablePll(ENABLE);
/* Wait till PLL is ready */
while (RCC_GetFlagStatus(RCC_FLAG_PLLRD) == RESET)
;
/* Select PLL as system clock source */
RCC_ConfigSysclk(RCC_SYSCLK_SRC_PLLCLK);
/* Wait till PLL is used as system clock source */
while (RCC_GetSysclkSrc() != 0x08)
;
}
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-08-20 breo.com first version
*/
#ifndef __DRV_CLK_H__
#define __DRV_CLK_H__
#include <stdint.h>
#include <rtthread.h>
#include <rthw.h>
#ifdef RT_USING_DEVICE
#include <rtdevice.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
void DumpClock(const char *msg);
void SetSysClockToHSI(void);
void SetSysClockToHSE(void);
enum
{
SYSCLK_PLLSRC_HSI,
SYSCLK_PLLSRC_HSE,
};
void SetSysClockToPLL(uint32_t freq, uint8_t src);
#ifdef __cplusplus
}
#endif
#endif
......@@ -763,7 +763,6 @@ int n32_hw_pin_init(void)
result = rt_device_pin_register("pin", &_n32_pin_ops, RT_NULL);
return result;
}
INIT_BOARD_EXPORT(n32_hw_pin_init);
rt_inline void pin_irq_hdr(int irqno)
{
......
......@@ -10,5 +10,6 @@
#ifndef GPIO_H__
#define GPIO_H__
int n32_hw_pin_init(void);
#endif
......@@ -49,34 +49,6 @@ enum
#ifdef BSP_USING_HW_TIM8
TIM8_INDEX,
#endif
#ifdef BSP_USING_HWTIM9
TIM9_INDEX,
#endif
#ifdef BSP_USING_HWTIM10
TIM10_INDEX,
#endif
#ifdef BSP_USING_HWTIM11
TIM11_INDEX,
#endif
#ifdef BSP_USING_HWTIM12
TIM12_INDEX,
#endif
#ifdef BSP_USING_HWTIM13
TIM13_INDEX,
#endif
#ifdef BSP_USING_HWTIM14
TIM14_INDEX,
#endif
#ifdef BSP_USING_HWTIM15
TIM15_INDEX,
#endif
};
struct n32_hwtimer
......@@ -120,34 +92,6 @@ static struct n32_hwtimer n32_hwtimer_obj[] =
#ifdef BSP_USING_HWTIM8
TIM8_CONFIG,
#endif
#ifdef BSP_USING_HWTIM9
TIM9_CONFIG,
#endif
#ifdef BSP_USING_HWTIM10
TIM10_CONFIG,
#endif
#ifdef BSP_USING_HWTIM11
TIM11_CONFIG,
#endif
#ifdef BSP_USING_HWTIM12
TIM12_CONFIG,
#endif
#ifdef BSP_USING_HWTIM13
TIM13_CONFIG,
#endif
#ifdef BSP_USING_HWTIM14
TIM14_CONFIG,
#endif
#ifdef BSP_USING_HWTIM15
TIM15_CONFIG,
#endif
};
static void n32_timer_init(struct rt_hwtimer_device *timer, rt_uint32_t state)
......@@ -155,6 +99,8 @@ static void n32_timer_init(struct rt_hwtimer_device *timer, rt_uint32_t state)
RCC_ClocksType RCC_ClockStruct;
TIM_TimeBaseInitType TIM_TimeBaseStructure;
NVIC_InitType NVIC_InitStructure;
uint32_t freq = 0;
uint32_t input_clock;
uint32_t prescaler_value = 0;
TIM_Module *tim = RT_NULL;
struct n32_hwtimer *tim_device = RT_NULL;
......@@ -165,18 +111,22 @@ static void n32_timer_init(struct rt_hwtimer_device *timer, rt_uint32_t state)
tim = (TIM_Module *)timer->parent.user_data;
tim_device = (struct n32_hwtimer *)timer;
RT_ASSERT((tim == TIM2) || (tim == TIM3) || (tim == TIM4) || (tim == TIM5)
|| (tim == TIM6) || (tim == TIM7));
/* timer clock enable */
n32_msp_hwtim_init(tim);
/* timer init */
freq = timer->freq;
RCC_GetClocksFreqValue(&RCC_ClockStruct);
/* Set timer clock is 1Mhz */
prescaler_value = (uint32_t)(RCC_ClockStruct.SysclkFreq / 10000) - 1;
if (1 == (RCC_ClockStruct.HclkFreq / RCC_ClockStruct.Pclk1Freq))
input_clock = RCC_ClockStruct.Pclk1Freq;
else
input_clock = RCC_ClockStruct.Pclk1Freq * 2;
prescaler_value = (uint32_t)(input_clock / freq) - 1;
TIM_TimeBaseStructure.Period = 10000 - 1;
rt_kprintf("Period=[%d]", TIM_TimeBaseStructure.Period);
TIM_TimeBaseStructure.Period = freq - 1;
TIM_TimeBaseStructure.Prescaler = prescaler_value;
rt_kprintf("Prescaler=[%d]", TIM_TimeBaseStructure.Prescaler);
TIM_TimeBaseStructure.ClkDiv = TIM_CLK_DIV1;
TIM_TimeBaseStructure.RepetCnt = 0;
......@@ -274,6 +224,7 @@ static rt_err_t n32_timer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg)
{
case HWTIMER_CTRL_FREQ_SET:
{
rt_uint32_t input_clock;
rt_uint32_t freq;
rt_uint16_t val;
......@@ -282,9 +233,11 @@ static rt_err_t n32_timer_ctrl(rt_hwtimer_t *timer, rt_uint32_t cmd, void *arg)
/* time init */
RCC_GetClocksFreqValue(&RCC_ClockStruct);
val = RCC_ClockStruct.SysclkFreq / freq;
if (1 == (RCC_ClockStruct.HclkFreq / RCC_ClockStruct.Pclk1Freq))
input_clock = RCC_ClockStruct.Pclk1Freq;
else
input_clock = RCC_ClockStruct.Pclk1Freq * 2;
val = input_clock / freq;
TIM_ConfigPrescaler(tim, val - 1, TIM_PSC_RELOAD_MODE_IMMEDIATE);
}
break;
......
......@@ -22,7 +22,7 @@ extern "C" {
#define TIM_DEV_INFO_CONFIG \
{ \
.maxfreq = 1000000, \
.minfreq = 4000, \
.minfreq = 1000, \
.maxcnt = 0xFFFF, \
.cntmode = HWTIMER_CNTMODE_UP, \
}
......
......@@ -214,7 +214,6 @@ int rt_hw_i2c_init(void)
return RT_EOK;
}
INIT_BOARD_EXPORT(rt_hw_i2c_init);
#endif /* RT_USING_I2C */
......@@ -554,5 +554,4 @@ int rt_hw_usart_init(void)
return RT_EOK;
}
INIT_BOARD_EXPORT(rt_hw_usart_init);
......@@ -11,5 +11,6 @@
#ifndef __USART_H__
#define __USART_H__
int rt_hw_usart_init(void);
#endif
......@@ -31,6 +31,7 @@ CONFIG_RT_TIMER_THREAD_STACK_SIZE=512
# CONFIG_RT_KSERVICE_USING_STDLIB is not set
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
# CONFIG_RT_USING_ASM_MEMCPY is not set
# CONFIG_RT_USING_TINY_FFS is not set
CONFIG_RT_DEBUG=y
# CONFIG_RT_DEBUG_COLOR is not set
# CONFIG_RT_DEBUG_INIT_CONFIG is not set
......@@ -134,7 +135,7 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64
# CONFIG_RT_USING_I2C is not set
# CONFIG_RT_USING_PHY is not set
CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_ADC is not set
CONFIG_RT_USING_ADC=y
# CONFIG_RT_USING_DAC is not set
CONFIG_RT_USING_PWM=y
# CONFIG_RT_USING_MTD_NOR is not set
......@@ -167,6 +168,7 @@ CONFIG_RT_LIBC_USING_TIME=y
# CONFIG_RT_LIBC_USING_FILEIO is not set
# CONFIG_RT_USING_MODULE is not set
CONFIG_RT_LIBC_DEFAULT_TIMEZONE=8
# CONFIG_RT_USING_POSIX is not set
# CONFIG_RT_USING_PTHREADS is not set
#
......@@ -580,14 +582,14 @@ CONFIG_SOC_N32G452XX=y
#
# Onboard Peripheral Drivers
#
CONFIG_BSP_USING_UART=y
#
# On-chip Peripheral Drivers
#
CONFIG_RT_USING_GPIO=y
CONFIG_BSP_USING_GPIO=y
# CONFIG_BSP_USING_ON_CHIP_FLASH is not set
# CONFIG_BSP_USING_WDT is not set
CONFIG_BSP_USING_UART=y
CONFIG_BSP_USING_UART1=y
# CONFIG_BSP_USING_UART2 is not set
# CONFIG_BSP_USING_UART3 is not set
......
......@@ -9,9 +9,9 @@ config SOC_N32G452XX
menu "Onboard Peripheral Drivers"
config RT_USING_SERIAL
config BSP_USING_UART
bool "Enable USART (uart1)"
select BSP_USING_UART
select RT_USING_SERIAL
select BSP_USING_UART1
default y
......@@ -19,7 +19,7 @@ endmenu
menu "On-chip Peripheral Drivers"
config RT_USING_GPIO
config BSP_USING_GPIO
bool "Enable GPIO"
select RT_USING_PIN
default y
......
......@@ -13,6 +13,7 @@
#include <rtthread.h>
#include <board.h>
#include <drv_clk.h>
#ifdef BSP_USING_SRAM
#include "drv_sram.h"
......@@ -72,6 +73,16 @@ void rt_hw_board_init()
SystemClock_Config();
#ifdef RT_USING_PIN
int n32_hw_pin_init(void);
n32_hw_pin_init();
#endif
#ifdef RT_USING_SERIAL
int rt_hw_usart_init(void);
rt_hw_usart_init();
#endif
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init();
#endif
......
......@@ -8,7 +8,8 @@
* 2021-08-20 breo.com first version
*/
#include <stdio.h>
#include <string.h>
#include <rtthread.h>
#include <rtdevice.h>
#include "n32g45x.h"
......@@ -383,7 +384,7 @@ static void uart_test(void)
static rt_device_t u2 = NULL;
uart_test_rw(u2, "uart2");
#endif
#ifdef BSP_USING_UART2
#ifdef BSP_USING_UART3
static rt_device_t u3 = NULL;
uart_test_rw(u3, "uart3");
#endif
......
......@@ -84,6 +84,7 @@
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_PIN
#define RT_USING_ADC
#define RT_USING_PWM
#define RT_USING_WDT
......@@ -175,10 +176,11 @@
/* Onboard Peripheral Drivers */
#define BSP_USING_UART
/* On-chip Peripheral Drivers */
#define RT_USING_GPIO
#define BSP_USING_UART
#define BSP_USING_GPIO
#define BSP_USING_UART1
#endif
......@@ -19,18 +19,20 @@ else:
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'/opt/gcc-arm-none-eabi-6_2-2016q4/bin'
if ('EXEC_PATH' in dir()) == False:
EXEC_PATH = r'/opt/gcc-arm-none-eabi-6_2-2016q4/bin'
elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc'
EXEC_PATH = r'C:/Keil_v5'
if ('EXEC_PATH' in dir()) == False:
EXEC_PATH = r'C:/Keil_v5'
elif CROSS_TOOL == 'iar':
PLATFORM = 'iar'
EXEC_PATH = r'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.0'
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
if ('EXEC_PATH' in dir()) == False:
EXEC_PATH = r'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.0'
BUILD = 'debug'
......
......@@ -17,13 +17,4 @@ config PKGS_DIR
source "$RTT_DIR/Kconfig"
source "$PKGS_DIR/Kconfig"
config SOC_VEXPRESS_A9
bool
select ARCH_ARM_CORTEX_A9
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
select RT_USING_GIC_V2
default y
source "$BSP_DIR/drivers/Kconfig"
menu "Hardware Drivers Config"
config SOC_VEXPRESS_A9
bool
select ARCH_ARM_CORTEX_A9
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
select RT_USING_GIC_V2
default y
menu "Onboard Peripheral Drivers"
config RT_USING_UART0
bool "Enable UART0"
default n
default y
config RT_USING_UART1
bool "Enable UART1"
default y
config BSP_USING_LVGL
bool "Enable LVGL for LCD"
select PKG_USING_LVGL
default n
config BSP_DRV_CLCD
bool "CLCD driver"
depends on PKG_USING_GUIENGINE
depends on PKG_USING_GUIENGINE || BSP_USING_LVGL
default y
config BSP_DRV_MOUSE
bool "MOUSE driver"
depends on PKG_USING_GUIENGINE || BSP_USING_LVGL
default y
if BSP_DRV_CLCD
config BSP_LCD_WIDTH
int "Width of LCD panel"
default 640
int "Width of LCD panel"
default 640
config BSP_LCD_HEIGHT
int "Height of LCD panel"
default 480
int "Height of LCD panel"
default 480
endif
config BSP_DRV_EMAC
bool "EMAC driver"
depends on RT_USING_LWIP
default y
bool "Enable EMAC driver"
select RT_USING_LWIP
select RT_USING_SAL
select SAL_USING_POSIX
default n
config BSP_DRV_AUDIO
bool "Audio driver"
select RT_USING_AUDIO
default n
endmenu
endmenu
......@@ -20,6 +20,8 @@
#define DBG_LVL DBG_INFO
#include "rtdbg.h"
#ifdef BSP_DRV_MOUSE
#define MOUSE_ADDRESS (0x10007000)
#define MOUSE_IRQ_NUM (IRQ_VEXPRESS_A9_MOUSE)
#define MOUSE_XMAX (BSP_LCD_WIDTH)
......@@ -34,9 +36,15 @@
#define MOUSE_BUTTON_WHELL (0x80)
#ifdef PKG_USING_GUIENGINE
#include <rtgui/event.h>
#include <rtgui/rtgui_server.h>
#elif defined(PKG_USING_LITTLEVGL2RTT)
#include <littlevgl2rtt.h>
#elif defined(PKG_USING_LVGL)
#include <lvgl.h>
#include <lv_port_indev.h>
static rt_bool_t touch_down = RT_FALSE;
#endif
typedef rt_uint32_t virtual_addr_t;
......@@ -110,6 +118,7 @@ static rt_uint32_t emouse_id;
void push_event_touch_move(int x, int y)
{
#ifdef PKG_USING_GUIENGINE
struct rtgui_event_mouse emouse;
emouse.parent.sender = RT_NULL;
......@@ -124,10 +133,16 @@ void push_event_touch_move(int x, int y)
LOG_D("[line]:%d motion event id:%d x:%d y:%d", __LINE__, emouse.id, x, y);
rtgui_server_post_event(&emouse.parent, sizeof(emouse));
#elif defined(PKG_USING_LITTLEVGL2RTT)
littlevgl2rtt_send_input_event(x, y, LITTLEVGL2RTT_INPUT_MOVE);
#elif defined(PKG_USING_LVGL)
lv_port_indev_input(x, y, (touch_down == RT_TRUE) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL);
#endif
}
void push_event_touch_begin(int x, int y)
{
#ifdef PKG_USING_GUIENGINE
struct rtgui_event_mouse emouse;
emouse_id = rt_tick_get();
......@@ -143,10 +158,17 @@ void push_event_touch_begin(int x, int y)
emouse.id = emouse_id;
LOG_D("[line]:%d down event id:%d x:%d y:%d", __LINE__, emouse.id, x, y);
rtgui_server_post_event(&emouse.parent, sizeof(emouse));
#elif defined(PKG_USING_LITTLEVGL2RTT)
littlevgl2rtt_send_input_event(x, y, LITTLEVGL2RTT_INPUT_DOWN);
#elif defined(PKG_USING_LVGL)
touch_down = RT_TRUE;
lv_port_indev_input(x, y, (touch_down == RT_TRUE) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL);
#endif
}
void push_event_touch_end(int x, int y)
{
#ifdef PKG_USING_GUIENGINE
struct rtgui_event_mouse emouse;
emouse.parent.sender = RT_NULL;
......@@ -158,9 +180,15 @@ void push_event_touch_end(int x, int y)
emouse.y = y;
emouse.ts = rt_tick_get();
emouse.id = emouse_id;
LOG_D("[line]:%d up event id:%d x:%d y:%d", __LINE__, emouse.id, x, y);
rtgui_server_post_event(&emouse.parent, sizeof(emouse));
#elif defined(PKG_USING_LITTLEVGL2RTT)
littlevgl2rtt_send_input_event(x, y, LITTLEVGL2RTT_INPUT_MOVE);
#elif defined(PKG_USING_LVGL)
touch_down = RT_FALSE;
lv_port_indev_input(x, y, (touch_down == RT_TRUE) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL);
#endif
}
static void mouse_pl050_interrupt(int irq, void * data)
......@@ -243,7 +271,7 @@ int rt_hw_mouse_init(void)
((read32(virt + 0xfe8) & 0xff) << 16) |
((read32(virt + 0xfe4) & 0xff) << 8) |
((read32(virt + 0xfe0) & 0xff) << 0));
if(((id >> 12) & 0xff) != 0x41 || (id & 0xfff) != 0x050)
{
LOG_E("read id fail id:0x%08x", id);
......
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
dir_path:
- demo
from building import *
import os
cwd = GetCurrentDir()
group = []
src = Glob('*.c')
CPPPATH = [cwd]
CPPDEFINES = ['STM32F4']
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
group = group + SConscript(os.path.join(d, 'SConscript'))
group += DefineGroup('LVGL-port', src, depend = ['BSP_USING_LVGL'], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
Return('group')
import rtconfig
from building import *
cwd = GetCurrentDir()
src = Glob('*.c') + Glob('*.cpp')
path = [cwd]
path += [cwd + '/src']
src += Glob('src/lv_demo_music/*.c')
src += Glob('src/lv_demo_music/assets/*.c')
path += [cwd + '/src/lv_demo_music']
path += [cwd + '/src/lv_demo_music/assets']
group = DefineGroup('LVGL-demo', src, depend = ['BSP_USING_LVGL'], CPPPATH = path)
Return('group')
/**
* @file lv_examples.h
*
*/
#ifndef LV_DEMO_H
#define LV_DEMO_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
/*If "lv_conf.h" is available from here try to use it later.*/
#ifdef __has_include
# if __has_include("lvgl.h")
# ifndef LV_LVGL_H_INCLUDE_SIMPLE
# define LV_LVGL_H_INCLUDE_SIMPLE
# endif
# endif
#endif
#ifdef __has_include
# if __has_include("lv_demo_conf.h")
# ifndef LV_DEMO_CONF_INCLUDE_SIMPLE
# define LV_DEMO_CONF_INCLUDE_SIMPLE
# endif
# endif
#endif
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include <lvgl.h>
#else
#include <lvgl.h>
#endif
#if defined(LV_DEMO_CONF_PATH)
#define __LV_TO_STR_AUX(x) #x
#define __LV_TO_STR(x) __LV_TO_STR_AUX(x)
#include __LV_TO_STR(LV_DEMO_CONF_PATH)
#undef __LV_TO_STR_AUX
#undef __LV_TO_STR
#elif defined(LV_DEMO_CONF_INCLUDE_SIMPLE)
#include "lv_demo_conf.h"
#else
#include <lv_conf.h>
#endif
#include "src/lv_demo_music/lv_demo_music.h"
/*********************
* DEFINES
*********************/
/*Test lvgl version*/
#if LV_VERSION_CHECK(8, 0, 0) == 0
#error "lv_demo: Wrong lvgl version"
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_DEMO_H*/
/**
* @file lv_examples.h
* This file exists only to be compatible with Arduino's library structure
*/
#ifndef LV_DEMO_SRC_H
#define LV_DEMO_SRC_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_demo.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_DEMO_SRC_H*/
# Music player demo
## Overview
The music player demo shows what kind of modern, smartphone-like user interfaces can be created on LVGL. It works the best with display with 480x272 or 272x480 resolution.
![Music player demo with LVGL embedded GUI library](https://github.com/lvgl/lv_examples/blob/master/src/lv_demo_music/screenshot1.gif?raw=true)
## Run the demo
- In `lv_ex_conf.h` set `LV_USE_DEMO_MUSIC 1`
- With `LV_DEMO_MUSIC_AUTO_PLAY` enabled a ~60 sec demo will be played.
- After `lv_init()` and initializing the drivers call `lv_demo_music()`
## How the spectrum animation works
- `assets/spectrum.py` creates an array of spectrum values from a music. 4 band are created with 33 samples/sec: bass, bass-mid, mid, mid-treble.
- The spectrum meter UI does the followings:
- Zoom the album cover proportionality to the current bass value
- Display the 4 bands on the left side of a circle by default at 0°, 45°, 90°, 135°
- Add extra bars next to the "main bars" with a cosine shape. Add more bars for the lower bands.
- If the there is a large enough bass add a random offset to the position of the bars. E.g. start from 63° istead of 0°. (bars greater than 180° start again from 0°)
- If there no bass add 1 to the offset of the bars (it creates a "walking" effect)
- Mirror the bars to the right side of the circle
## Using spectrum.py
- install `librosa` with `pip3 install librosa`
- run `python sectrum.py my_file.mp3`
- see the result in `spectrum.h`
const uint16_t spectrum_1[][4] = {
{ 0, 0, 0, 0, },
{ 0, 9, 7, 8, },
{ 5, 39, 24, 29, },
{ 14, 44, 34, 45, },
{ 16, 25, 32, 48, },
{ 16, 18, 29, 44, },
{ 15, 20, 26, 40, },
{ 15, 19, 24, 37, },
{ 14, 19, 27, 42, },
{ 13, 17, 29, 39, },
{ 12, 17, 24, 31, },
{ 11, 17, 24, 29, },
{ 9, 19, 22, 26, },
{ 6, 19, 27, 35, },
{ 4, 18, 28, 38, },
{ 2, 17, 20, 26, },
{ 1, 15, 16, 20, },
{ 1, 27, 18, 18, },
{ 8, 52, 22, 31, },
{ 16, 44, 20, 39, },
{ 16, 29, 15, 25, },
{ 16, 28, 12, 14, },
{ 16, 27, 17, 14, },
{ 15, 23, 53, 36, },
{ 12, 20, 69, 51, },
{ 11, 19, 53, 47, },
{ 11, 20, 47, 43, },
{ 10, 19, 45, 43, },
{ 8, 16, 41, 43, },
{ 5, 15, 43, 46, },
{ 3, 12, 38, 42, },
{ 2, 12, 27, 36, },
{ 1, 12, 21, 35, },
{ 2, 34, 26, 34, },
{ 12, 55, 30, 30, },
{ 17, 38, 19, 18, },
{ 16, 25, 13, 13, },
{ 16, 21, 13, 11, },
{ 16, 17, 18, 19, },
{ 14, 18, 23, 40, },
{ 14, 16, 28, 44, },
{ 13, 17, 24, 35, },
{ 12, 15, 17, 32, },
{ 11, 14, 16, 27, },
{ 8, 13, 16, 27, },
{ 5, 12, 19, 28, },
{ 3, 11, 21, 32, },
{ 1, 16, 19, 29, },
{ 0, 20, 16, 18, },
{ 0, 20, 16, 29, },
{ 0, 17, 21, 46, },
{ 0, 13, 23, 41, },
{ 0, 11, 21, 33, },
{ 0, 11, 18, 31, },
{ 2, 34, 25, 32, },
{ 12, 52, 29, 36, },
{ 17, 28, 24, 36, },
{ 16, 19, 23, 33, },
{ 16, 19, 22, 30, },
{ 15, 19, 21, 31, },
{ 15, 19, 24, 35, },
{ 14, 20, 24, 35, },
{ 13, 21, 19, 22, },
{ 13, 21, 16, 15, },
{ 11, 20, 25, 17, },
{ 7, 21, 62, 42, },
{ 4, 19, 72, 56, },
{ 2, 15, 55, 49, },
{ 1, 15, 49, 40, },
{ 1, 17, 41, 31, },
{ 1, 20, 36, 33, },
{ 0, 19, 33, 36, },
{ 1, 15, 30, 31, },
{ 0, 17, 25, 22, },
{ 0, 20, 19, 15, },
{ 0, 20, 19, 14, },
{ 0, 17, 23, 15, },
{ 0, 15, 19, 14, },
{ 0, 15, 15, 14, },
{ 0, 12, 15, 18, },
{ 0, 11, 15, 25, },
{ 0, 12, 23, 43, },
{ 0, 14, 26, 48, },
{ 0, 12, 21, 36, },
{ 0, 11, 18, 27, },
{ 1, 21, 21, 25, },
{ 8, 42, 28, 30, },
{ 16, 34, 25, 29, },
{ 16, 22, 20, 20, },
{ 16, 22, 16, 14, },
{ 17, 21, 14, 15, },
{ 15, 16, 21, 33, },
{ 13, 15, 29, 46, },
{ 13, 16, 26, 37, },
{ 13, 15, 22, 32, },
{ 11, 14, 20, 30, },
{ 8, 12, 24, 34, },
{ 6, 15, 27, 40, },
{ 3, 17, 23, 34, },
{ 2, 16, 18, 28, },
{ 0, 13, 17, 29, },
{ 2, 31, 22, 26, },
{ 12, 52, 27, 33, },
{ 17, 34, 21, 35, },
{ 16, 23, 15, 22, },
{ 17, 20, 12, 17, },
{ 16, 23, 29, 21, },
{ 13, 22, 66, 39, },
{ 12, 20, 67, 47, },
{ 12, 21, 50, 40, },
{ 11, 23, 44, 32, },
{ 10, 23, 37, 31, },
{ 7, 17, 34, 40, },
{ 5, 14, 35, 49, },
{ 3, 12, 29, 41, },
{ 1, 12, 27, 37, },
{ 0, 16, 26, 31, },
{ 4, 40, 34, 32, },
{ 14, 47, 30, 29, },
{ 17, 25, 17, 21, },
{ 16, 22, 13, 14, },
{ 17, 20, 14, 14, },
{ 15, 17, 20, 27, },
{ 14, 15, 26, 44, },
{ 13, 16, 27, 41, },
{ 13, 16, 23, 29, },
{ 12, 14, 21, 27, },
{ 10, 14, 21, 28, },
{ 7, 16, 24, 31, },
{ 4, 12, 25, 32, },
{ 2, 11, 21, 25, },
{ 1, 10, 14, 14, },
{ 0, 11, 14, 16, },
{ 0, 13, 18, 35, },
{ 0, 13, 22, 45, },
{ 0, 11, 20, 37, },
{ 0, 11, 16, 29, },
{ 0, 14, 15, 22, },
{ 5, 40, 25, 24, },
{ 14, 44, 30, 37, },
{ 15, 24, 27, 35, },
{ 15, 15, 23, 31, },
{ 16, 12, 19, 28, },
{ 15, 13, 21, 31, },
{ 14, 16, 24, 41, },
{ 13, 16, 22, 39, },
{ 13, 13, 20, 29, },
{ 12, 15, 18, 19, },
{ 9, 18, 34, 24, },
{ 7, 18, 69, 49, },
{ 4, 17, 68, 55, },
{ 2, 16, 54, 51, },
{ 1, 14, 51, 47, },
{ 1, 13, 44, 46, },
{ 0, 11, 35, 43, },
{ 1, 11, 32, 40, },
{ 1, 11, 29, 39, },
{ 0, 9, 26, 34, },
{ 0, 12, 26, 31, },
{ 0, 13, 28, 31, },
{ 0, 13, 27, 30, },
{ 0, 12, 26, 28, },
{ 0, 10, 25, 27, },
{ 0, 11, 21, 26, },
{ 0, 11, 21, 28, },
{ 0, 13, 25, 40, },
{ 0, 14, 25, 37, },
{ 0, 13, 22, 33, },
{ 0, 14, 18, 29, },
{ 2, 30, 19, 26, },
{ 11, 51, 28, 36, },
{ 16, 32, 30, 39, },
{ 15, 23, 28, 33, },
{ 16, 19, 26, 29, },
{ 16, 18, 24, 26, },
{ 14, 20, 26, 32, },
{ 14, 21, 29, 37, },
{ 13, 22, 26, 28, },
{ 12, 22, 20, 17, },
{ 11, 23, 19, 16, },
{ 8, 23, 28, 27, },
{ 5, 18, 32, 40, },
{ 3, 17, 27, 33, },
{ 1, 15, 23, 20, },
{ 0, 17, 20, 15, },
{ 4, 41, 25, 25, },
{ 14, 51, 26, 34, },
{ 17, 32, 19, 26, },
{ 16, 28, 12, 16, },
{ 17, 25, 10, 11, },
{ 16, 28, 39, 25, },
{ 13, 24, 68, 47, },
{ 11, 22, 61, 48, },
{ 12, 20, 49, 44, },
{ 11, 19, 48, 40, },
{ 9, 17, 41, 41, },
{ 7, 15, 39, 45, },
{ 4, 14, 38, 45, },
{ 3, 16, 29, 36, },
{ 1, 15, 25, 33, },
{ 1, 21, 24, 33, },
{ 7, 46, 31, 31, },
{ 16, 41, 25, 23, },
{ 16, 23, 17, 16, },
{ 16, 21, 13, 11, },
{ 16, 18, 12, 11, },
{ 15, 19, 18, 29, },
{ 14, 17, 25, 53, },
{ 13, 17, 24, 44, },
{ 13, 16, 18, 32, },
{ 12, 16, 15, 27, },
{ 9, 15, 17, 29, },
{ 6, 15, 20, 30, },
{ 4, 13, 20, 31, },
{ 2, 15, 18, 27, },
{ 1, 16, 16, 16, },
{ 0, 15, 17, 20, },
{ 0, 15, 21, 39, },
{ 0, 14, 25, 43, },
{ 0, 12, 22, 34, },
{ 0, 10, 18, 30, },
{ 1, 20, 20, 28, },
{ 8, 45, 29, 38, },
{ 16, 40, 29, 40, },
{ 16, 24, 27, 28, },
{ 17, 20, 23, 20, },
{ 17, 21, 21, 18, },
{ 15, 23, 22, 25, },
{ 14, 22, 24, 37, },
{ 13, 23, 20, 28, },
{ 13, 23, 16, 17, },
{ 11, 21, 16, 15, },
{ 9, 20, 47, 29, },
{ 6, 19, 76, 49, },
{ 3, 18, 64, 49, },
{ 2, 19, 52, 46, },
{ 1, 19, 50, 43, },
{ 1, 18, 42, 41, },
{ 0, 17, 37, 43, },
{ 1, 14, 33, 42, },
{ 1, 13, 26, 36, },
{ 0, 13, 23, 31, },
{ 0, 14, 23, 28, },
{ 0, 17, 31, 32, },
{ 0, 16, 28, 32, },
{ 0, 13, 18, 25, },
{ 0, 11, 13, 20, },
{ 0, 11, 11, 19, },
{ 0, 12, 17, 37, },
{ 0, 14, 25, 50, },
{ 0, 14, 23, 42, },
{ 0, 12, 18, 34, },
{ 0, 13, 20, 29, },
{ 4, 37, 29, 28, },
{ 14, 49, 30, 31, },
{ 17, 28, 25, 29, },
{ 16, 21, 18, 19, },
{ 17, 20, 15, 14, },
{ 16, 20, 16, 23, },
{ 14, 18, 25, 43, },
{ 13, 17, 28, 44, },
{ 13, 17, 22, 28, },
{ 12, 17, 21, 21, },
{ 10, 19, 22, 18, },
{ 7, 22, 26, 25, },
{ 4, 19, 27, 35, },
{ 2, 16, 22, 28, },
{ 1, 17, 18, 19, },
{ 1, 25, 18, 17, },
{ 7, 46, 25, 28, },
{ 16, 38, 24, 37, },
{ 16, 20, 20, 29, },
{ 17, 21, 14, 16, },
{ 17, 22, 16, 13, },
{ 15, 25, 51, 30, },
{ 12, 20, 71, 48, },
{ 12, 22, 57, 48, },
{ 12, 22, 49, 39, },
{ 11, 23, 44, 33, },
{ 9, 20, 37, 32, },
{ 6, 21, 39, 44, },
{ 4, 17, 36, 46, },
{ 2, 17, 28, 34, },
{ 1, 20, 22, 21, },
{ 2, 34, 21, 16, },
{ 10, 58, 28, 16, },
{ 17, 40, 20, 14, },
{ 16, 25, 12, 11, },
{ 17, 18, 14, 10, },
{ 16, 17, 15, 14, },
{ 15, 20, 25, 37, },
{ 14, 21, 27, 47, },
{ 13, 19, 22, 34, },
{ 13, 17, 18, 25, },
{ 11, 17, 15, 23, },
{ 8, 19, 18, 22, },
{ 6, 18, 19, 22, },
{ 3, 15, 21, 23, },
{ 1, 15, 21, 20, },
{ 0, 12, 16, 14, },
{ 0, 11, 19, 27, },
{ 0, 15, 27, 44, },
{ 0, 13, 27, 40, },
{ 0, 10, 22, 30, },
{ 0, 10, 18, 26, },
{ 2, 28, 24, 26, },
{ 11, 51, 30, 33, },
{ 17, 30, 28, 40, },
{ 16, 19, 23, 34, },
{ 17, 18, 21, 25, },
{ 16, 17, 23, 23, },
{ 14, 14, 27, 31, },
{ 14, 11, 26, 36, },
{ 13, 17, 22, 27, },
{ 12, 21, 19, 17, },
{ 11, 20, 21, 15, },
{ 8, 20, 57, 38, },
{ 5, 20, 71, 54, },
{ 3, 14, 57, 54, },
{ 1, 13, 52, 44, },
{ 0, 15, 50, 38, },
{ 1, 16, 41, 33, },
{ 0, 20, 31, 28, },
{ 1, 18, 26, 22, },
{ 0, 20, 22, 17, },
{ 0, 20, 21, 16, },
{ 0, 20, 23, 20, },
{ 0, 23, 22, 25, },
{ 0, 22, 21, 24, },
{ 0, 22, 19, 21, },
{ 0, 23, 17, 21, },
{ 0, 23, 19, 28, },
{ 0, 23, 29, 39, },
{ 0, 17, 32, 43, },
{ 0, 17, 25, 38, },
{ 0, 20, 20, 26, },
{ 1, 22, 19, 19, },
{ 2, 28, 26, 19, },
{ 2, 29, 35, 15, },
{ 2, 28, 45, 14, },
{ 8, 28, 51, 15, },
{ 11, 27, 46, 14, },
{ 12, 26, 37, 13, },
{ 8, 27, 31, 12, },
{ 5, 22, 24, 11, },
{ 4, 13, 16, 10, },
{ 4, 6, 13, 9, },
{ 4, 5, 16, 11, },
{ 4, 7, 24, 16, },
{ 5, 8, 23, 19, },
{ 5, 6, 20, 20, },
{ 4, 5, 18, 19, },
{ 3, 4, 16, 16, },
{ 1, 3, 15, 15, },
{ 0, 2, 15, 13, },
{ 0, 1, 15, 11, },
{ 0, 1, 13, 11, },
{ 0, 1, 13, 12, },
{ 0, 2, 18, 14, },
{ 0, 3, 23, 16, },
{ 0, 3, 21, 17, },
{ 0, 3, 18, 15, },
{ 0, 5, 17, 13, },
{ 0, 5, 13, 9, },
{ 0, 3, 7, 4, },
{ 0, 1, 4, 2, },
{ 0, 0, 3, 1, },
{ 0, 0, 3, 1, },
{ 0, 0, 7, 4, },
{ 0, 0, 12, 8, },
{ 0, 0, 12, 10, },
{ 0, 0, 11, 10, },
{ 0, 0, 11, 9, },
{ 0, 1, 12, 9, },
{ 0, 2, 19, 12, },
{ 0, 3, 25, 15, },
{ 0, 4, 22, 16, },
{ 0, 5, 21, 14, },
{ 0, 4, 18, 9, },
{ 0, 4, 19, 11, },
{ 0, 5, 23, 16, },
{ 0, 5, 22, 14, },
{ 0, 4, 19, 12, },
{ 0, 5, 18, 12, },
{ 0, 4, 23, 13, },
{ 0, 5, 28, 15, },
{ 0, 4, 27, 17, },
{ 0, 3, 22, 17, },
{ 0, 3, 21, 16, },
{ 0, 3, 16, 11, },
{ 0, 2, 8, 5, },
{ 0, 0, 5, 3, },
{ 0, 0, 3, 1, },
{ 0, 0, 2, 1, },
{ 0, 1, 7, 4, },
{ 0, 2, 16, 10, },
{ 0, 3, 19, 14, },
{ 0, 3, 16, 13, },
{ 0, 3, 16, 14, },
{ 0, 2, 15, 13, },
{ 0, 2, 15, 13, },
{ 0, 3, 13, 12, },
{ 0, 3, 7, 5, },
{ 0, 1, 2, 1, },
{ 0, 0, 1, 1, },
{ 0, 0, 1, 1, },
{ 0, 0, 1, 1, },
{ 0, 0, 1, 0, },
{ 0, 0, 1, 0, },
{ 0, 0, 2, 1, },
{ 0, 1, 11, 7, },
{ 0, 3, 21, 15, },
{ 0, 4, 21, 17, },
{ 0, 4, 18, 15, },
{ 0, 4, 19, 15, },
{ 0, 4, 21, 13, },
{ 0, 4, 24, 17, },
{ 0, 4, 27, 24, },
{ 0, 3, 23, 22, },
{ 0, 3, 20, 17, },
{ 0, 4, 18, 16, },
{ 0, 6, 13, 10, },
{ 0, 5, 5, 3, },
{ 0, 1, 2, 1, },
{ 0, 0, 2, 1, },
{ 0, 0, 1, 1, },
{ 0, 0, 1, 1, },
{ 0, 0, 1, 0, },
{ 0, 0, 1, 0, },
{ 0, 0, 1, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
};
const uint16_t spectrum_2[][4] = {
{ 0, 0, 0, 0, },
{ 0, 8, 28, 14, },
{ 1, 35, 63, 31, },
{ 5, 62, 56, 35, },
{ 13, 49, 42, 30, },
{ 21, 24, 45, 31, },
{ 22, 15, 46, 37, },
{ 20, 9, 48, 35, },
{ 17, 12, 50, 33, },
{ 6, 11, 49, 35, },
{ 0, 10, 50, 40, },
{ 0, 11, 50, 37, },
{ 0, 14, 51, 37, },
{ 0, 18, 47, 33, },
{ 0, 16, 41, 27, },
{ 0, 13, 40, 24, },
{ 0, 10, 36, 23, },
{ 0, 7, 32, 25, },
{ 0, 7, 33, 25, },
{ 0, 7, 33, 29, },
{ 0, 8, 31, 33, },
{ 0, 8, 32, 32, },
{ 0, 9, 33, 31, },
{ 0, 11, 37, 31, },
{ 0, 13, 39, 33, },
{ 0, 16, 48, 47, },
{ 0, 11, 57, 45, },
{ 0, 7, 50, 36, },
{ 0, 5, 38, 29, },
{ 0, 5, 32, 30, },
{ 0, 4, 25, 26, },
{ 0, 5, 18, 17, },
{ 0, 5, 14, 12, },
{ 0, 6, 19, 17, },
{ 0, 5, 26, 22, },
{ 0, 16, 43, 27, },
{ 1, 46, 64, 31, },
{ 5, 60, 40, 24, },
{ 17, 42, 22, 16, },
{ 28, 23, 15, 9, },
{ 29, 16, 15, 10, },
{ 25, 12, 25, 20, },
{ 16, 14, 34, 24, },
{ 11, 13, 34, 24, },
{ 10, 11, 31, 26, },
{ 10, 15, 29, 23, },
{ 10, 15, 23, 13, },
{ 10, 15, 20, 7, },
{ 11, 15, 28, 12, },
{ 11, 13, 35, 20, },
{ 10, 14, 39, 23, },
{ 10, 14, 40, 28, },
{ 10, 14, 36, 29, },
{ 11, 13, 29, 21, },
{ 10, 13, 27, 15, },
{ 10, 15, 29, 17, },
{ 11, 16, 32, 26, },
{ 10, 15, 35, 27, },
{ 11, 29, 60, 30, },
{ 8, 56, 56, 27, },
{ 11, 54, 25, 17, },
{ 23, 28, 20, 13, },
{ 29, 16, 19, 11, },
{ 27, 12, 19, 17, },
{ 22, 14, 28, 24, },
{ 11, 15, 34, 25, },
{ 11, 11, 37, 26, },
{ 11, 12, 35, 26, },
{ 11, 13, 26, 19, },
{ 11, 17, 23, 16, },
{ 10, 26, 39, 39, },
{ 3, 20, 43, 48, },
{ 1, 14, 43, 38, },
{ 0, 12, 40, 31, },
{ 0, 9, 40, 31, },
{ 0, 8, 37, 30, },
{ 0, 8, 32, 30, },
{ 0, 5, 28, 33, },
{ 0, 4, 25, 28, },
{ 0, 6, 28, 21, },
{ 0, 6, 33, 19, },
{ 0, 5, 33, 21, },
{ 0, 4, 36, 25, },
{ 0, 4, 39, 34, },
{ 0, 4, 40, 35, },
{ 0, 4, 41, 31, },
{ 0, 4, 40, 28, },
{ 0, 4, 41, 26, },
{ 0, 4, 38, 33, },
{ 0, 3, 34, 31, },
{ 0, 4, 26, 21, },
{ 0, 10, 31, 18, },
{ 1, 41, 65, 22, },
{ 4, 67, 46, 14, },
{ 15, 55, 18, 6, },
{ 28, 26, 16, 5, },
{ 31, 14, 16, 6, },
{ 29, 9, 16, 6, },
{ 22, 16, 19, 6, },
{ 12, 15, 22, 7, },
{ 12, 13, 22, 7, },
{ 11, 13, 20, 6, },
{ 11, 14, 22, 7, },
{ 11, 18, 28, 20, },
{ 11, 23, 26, 21, },
{ 11, 18, 19, 9, },
{ 11, 15, 18, 5, },
{ 11, 14, 17, 4, },
{ 11, 16, 16, 9, },
{ 11, 18, 21, 21, },
{ 11, 21, 20, 16, },
{ 11, 17, 17, 6, },
{ 11, 16, 17, 4, },
{ 11, 16, 17, 4, },
{ 12, 18, 22, 17, },
{ 11, 21, 44, 44, },
{ 5, 14, 56, 52, },
{ 1, 11, 57, 41, },
{ 0, 9, 39, 29, },
{ 0, 8, 35, 25, },
{ 0, 9, 37, 22, },
{ 0, 12, 34, 21, },
{ 0, 9, 27, 21, },
{ 0, 5, 19, 17, },
{ 0, 4, 16, 14, },
{ 0, 18, 38, 17, },
{ 2, 52, 67, 22, },
{ 5, 66, 38, 17, },
{ 17, 43, 25, 18, },
{ 26, 18, 25, 18, },
{ 26, 11, 21, 18, },
{ 24, 10, 24, 18, },
{ 15, 16, 28, 21, },
{ 12, 14, 27, 22, },
{ 11, 13, 25, 20, },
{ 11, 15, 24, 15, },
{ 11, 16, 20, 12, },
{ 11, 16, 24, 10, },
{ 11, 18, 40, 15, },
{ 11, 14, 38, 19, },
{ 11, 14, 35, 23, },
{ 11, 13, 32, 28, },
{ 12, 13, 29, 19, },
{ 11, 14, 27, 18, },
{ 11, 15, 32, 26, },
{ 11, 14, 39, 27, },
{ 11, 15, 38, 29, },
{ 12, 19, 39, 24, },
{ 12, 34, 68, 25, },
{ 9, 63, 59, 25, },
{ 12, 57, 30, 22, },
{ 21, 27, 26, 19, },
{ 24, 16, 23, 21, },
{ 24, 17, 18, 16, },
{ 23, 19, 17, 12, },
{ 11, 22, 28, 21, },
{ 3, 22, 34, 26, },
{ 2, 21, 36, 28, },
{ 2, 24, 32, 24, },
{ 3, 39, 56, 25, },
{ 4, 58, 71, 39, },
{ 9, 50, 41, 36, },
{ 17, 29, 30, 28, },
{ 22, 20, 30, 22, },
{ 22, 14, 32, 23, },
{ 21, 13, 30, 23, },
{ 10, 22, 38, 26, },
{ 6, 47, 60, 31, },
{ 6, 64, 43, 23, },
{ 15, 48, 18, 12, },
{ 24, 24, 16, 9, },
{ 26, 15, 24, 13, },
{ 22, 13, 33, 21, },
{ 20, 15, 36, 30, },
{ 8, 29, 57, 33, },
{ 4, 57, 61, 27, },
{ 10, 54, 37, 21, },
{ 17, 29, 32, 22, },
{ 21, 16, 31, 26, },
{ 23, 11, 28, 26, },
{ 20, 13, 27, 19, },
{ 12, 21, 36, 19, },
{ 7, 48, 72, 31, },
{ 5, 68, 59, 32, },
{ 13, 51, 38, 31, },
{ 24, 24, 32, 29, },
{ 26, 16, 34, 28, },
{ 22, 10, 36, 26, },
{ 17, 15, 38, 27, },
{ 10, 14, 40, 28, },
{ 10, 10, 40, 32, },
{ 10, 12, 42, 35, },
{ 10, 13, 46, 34, },
{ 10, 15, 48, 31, },
{ 10, 17, 40, 26, },
{ 10, 17, 34, 24, },
{ 10, 14, 32, 24, },
{ 10, 13, 30, 22, },
{ 10, 13, 30, 23, },
{ 10, 14, 30, 21, },
{ 10, 15, 29, 22, },
{ 10, 14, 28, 22, },
{ 10, 15, 30, 25, },
{ 10, 17, 34, 28, },
{ 11, 20, 36, 33, },
{ 10, 21, 48, 49, },
{ 4, 14, 63, 54, },
{ 1, 11, 53, 41, },
{ 0, 10, 38, 25, },
{ 0, 9, 31, 18, },
{ 0, 10, 24, 20, },
{ 0, 12, 18, 16, },
{ 0, 8, 15, 11, },
{ 0, 5, 21, 14, },
{ 0, 5, 28, 15, },
{ 0, 15, 44, 18, },
{ 2, 46, 60, 23, },
{ 5, 61, 36, 15, },
{ 16, 42, 21, 11, },
{ 28, 21, 15, 7, },
{ 30, 15, 14, 7, },
{ 25, 13, 19, 12, },
{ 16, 14, 23, 12, },
{ 11, 12, 31, 13, },
{ 11, 10, 31, 13, },
{ 10, 13, 25, 14, },
{ 11, 17, 22, 10, },
{ 10, 16, 18, 7, },
{ 11, 15, 17, 10, },
{ 11, 14, 20, 11, },
{ 11, 13, 25, 15, },
{ 11, 14, 34, 17, },
{ 10, 14, 33, 15, },
{ 10, 14, 32, 15, },
{ 10, 13, 35, 14, },
{ 10, 13, 34, 14, },
{ 10, 14, 31, 14, },
{ 10, 14, 34, 15, },
{ 10, 32, 63, 21, },
{ 8, 62, 58, 17, },
{ 11, 57, 39, 11, },
{ 23, 27, 32, 11, },
{ 26, 15, 25, 11, },
{ 26, 12, 18, 11, },
{ 22, 14, 18, 10, },
{ 10, 15, 29, 13, },
{ 10, 14, 33, 13, },
{ 10, 13, 31, 14, },
{ 10, 15, 27, 13, },
{ 11, 19, 26, 17, },
{ 9, 25, 44, 39, },
{ 3, 19, 44, 46, },
{ 0, 14, 37, 36, },
{ 0, 11, 30, 23, },
{ 0, 9, 29, 19, },
{ 0, 8, 28, 17, },
{ 0, 8, 24, 16, },
{ 0, 5, 20, 17, },
{ 0, 4, 21, 17, },
{ 0, 3, 18, 13, },
{ 0, 16, 33, 15, },
{ 1, 47, 59, 23, },
{ 7, 60, 40, 19, },
{ 17, 40, 32, 15, },
{ 22, 21, 31, 12, },
{ 23, 13, 33, 13, },
{ 21, 13, 32, 12, },
{ 14, 20, 36, 14, },
{ 4, 20, 34, 16, },
{ 0, 21, 32, 17, },
{ 0, 23, 27, 14, },
{ 0, 29, 35, 13, },
{ 1, 56, 66, 23, },
{ 4, 71, 47, 15, },
{ 15, 55, 19, 4, },
{ 27, 26, 14, 3, },
{ 30, 15, 13, 3, },
{ 28, 8, 12, 4, },
{ 21, 14, 16, 8, },
{ 12, 14, 17, 7, },
{ 11, 12, 17, 4, },
{ 11, 13, 17, 3, },
{ 11, 13, 17, 3, },
{ 10, 13, 17, 7, },
{ 10, 13, 22, 18, },
{ 10, 14, 36, 23, },
{ 11, 12, 43, 22, },
{ 11, 12, 36, 21, },
{ 11, 13, 37, 20, },
{ 11, 14, 39, 19, },
{ 10, 16, 32, 18, },
{ 11, 15, 25, 17, },
{ 11, 15, 21, 13, },
{ 11, 13, 21, 11, },
{ 11, 15, 24, 18, },
{ 10, 21, 47, 44, },
{ 4, 15, 55, 50, },
{ 0, 12, 44, 38, },
{ 0, 11, 36, 30, },
{ 0, 12, 26, 24, },
{ 0, 11, 22, 17, },
{ 0, 10, 25, 24, },
{ 0, 6, 34, 28, },
{ 0, 3, 35, 25, },
{ 0, 4, 27, 23, },
{ 0, 16, 36, 18, },
{ 2, 49, 60, 19, },
{ 5, 65, 36, 16, },
{ 16, 42, 23, 24, },
{ 25, 19, 23, 24, },
{ 25, 11, 24, 19, },
{ 22, 8, 29, 22, },
{ 15, 15, 34, 26, },
{ 11, 13, 36, 27, },
{ 10, 14, 32, 23, },
{ 10, 16, 28, 17, },
{ 10, 16, 30, 15, },
{ 11, 21, 43, 30, },
{ 7, 22, 43, 44, },
{ 1, 13, 20, 40, },
{ 0, 10, 13, 33, },
{ 0, 9, 18, 32, },
{ 0, 9, 27, 43, },
{ 0, 9, 36, 49, },
{ 0, 6, 36, 35, },
{ 0, 2, 29, 28, },
{ 0, 1, 26, 26, },
{ 0, 1, 26, 27, },
{ 0, 1, 34, 28, },
{ 0, 1, 39, 35, },
{ 0, 1, 33, 35, },
{ 0, 2, 26, 34, },
{ 0, 2, 23, 32, },
{ 0, 2, 25, 28, },
{ 0, 2, 32, 37, },
{ 0, 2, 38, 45, },
{ 0, 2, 26, 41, },
{ 0, 2, 14, 28, },
{ 0, 2, 14, 26, },
{ 0, 8, 33, 35, },
{ 0, 16, 54, 51, },
{ 0, 16, 52, 52, },
{ 0, 15, 52, 43, },
{ 0, 14, 40, 28, },
{ 0, 13, 38, 27, },
{ 0, 14, 36, 26, },
{ 0, 18, 38, 24, },
{ 0, 15, 38, 24, },
{ 0, 13, 34, 27, },
{ 0, 13, 33, 27, },
{ 0, 13, 35, 27, },
{ 0, 14, 43, 35, },
{ 0, 14, 59, 45, },
{ 0, 10, 61, 39, },
{ 0, 9, 59, 34, },
{ 0, 11, 54, 37, },
{ 0, 15, 51, 39, },
{ 0, 15, 57, 37, },
{ 0, 12, 68, 37, },
{ 0, 9, 72, 43, },
{ 0, 10, 66, 45, },
{ 0, 13, 57, 47, },
{ 1, 39, 78, 49, },
{ 5, 63, 63, 37, },
{ 14, 48, 45, 33, },
{ 21, 23, 45, 36, },
{ 23, 15, 49, 39, },
{ 21, 10, 51, 39, },
{ 16, 13, 52, 38, },
{ 6, 12, 62, 38, },
{ 0, 10, 68, 45, },
{ 0, 12, 70, 46, },
{ 0, 18, 74, 45, },
{ 0, 21, 70, 42, },
{ 0, 18, 51, 33, },
{ 0, 15, 45, 29, },
{ 0, 12, 45, 30, },
{ 0, 9, 47, 30, },
{ 0, 9, 45, 28, },
{ 0, 11, 40, 31, },
{ 1, 11, 38, 39, },
{ 0, 11, 39, 46, },
{ 0, 12, 41, 42, },
{ 1, 14, 46, 36, },
{ 0, 16, 47, 38, },
{ 0, 16, 53, 55, },
{ 0, 10, 58, 54, },
{ 0, 9, 50, 37, },
{ 0, 7, 42, 28, },
{ 0, 5, 37, 30, },
{ 0, 5, 27, 27, },
{ 0, 6, 19, 18, },
{ 0, 7, 15, 13, },
{ 0, 8, 21, 17, },
{ 0, 6, 29, 23, },
{ 0, 16, 44, 27, },
{ 2, 46, 63, 29, },
{ 5, 60, 40, 24, },
{ 17, 43, 21, 16, },
{ 28, 22, 16, 9, },
{ 30, 15, 14, 11, },
{ 26, 13, 24, 21, },
{ 16, 16, 35, 25, },
{ 11, 14, 38, 25, },
{ 12, 12, 35, 27, },
{ 11, 15, 32, 24, },
{ 11, 16, 24, 13, },
{ 11, 16, 22, 9, },
{ 12, 15, 31, 16, },
{ 11, 15, 42, 23, },
{ 11, 14, 51, 26, },
{ 11, 14, 57, 31, },
{ 10, 14, 55, 32, },
{ 11, 13, 49, 24, },
{ 11, 14, 46, 21, },
{ 11, 15, 51, 23, },
{ 10, 15, 53, 29, },
{ 10, 14, 51, 28, },
{ 10, 26, 65, 31, },
{ 8, 54, 54, 28, },
{ 11, 53, 28, 20, },
{ 24, 28, 27, 15, },
{ 30, 15, 29, 13, },
{ 27, 11, 29, 18, },
{ 22, 13, 35, 24, },
{ 11, 14, 41, 27, },
{ 11, 11, 43, 26, },
{ 10, 11, 38, 25, },
{ 11, 13, 29, 19, },
{ 11, 17, 26, 18, },
{ 10, 26, 42, 46, },
{ 4, 20, 44, 56, },
{ 0, 15, 43, 41, },
{ 0, 12, 43, 31, },
{ 0, 9, 41, 32, },
{ 0, 8, 39, 30, },
{ 0, 9, 35, 31, },
{ 0, 5, 30, 32, },
{ 0, 4, 24, 29, },
{ 0, 6, 27, 21, },
{ 0, 6, 31, 19, },
{ 0, 5, 33, 20, },
{ 0, 4, 36, 24, },
{ 0, 5, 38, 32, },
{ 0, 4, 41, 37, },
{ 0, 4, 39, 32, },
{ 0, 4, 40, 28, },
{ 0, 3, 40, 29, },
{ 0, 3, 38, 34, },
{ 0, 3, 34, 32, },
{ 0, 4, 27, 22, },
{ 0, 10, 31, 19, },
{ 1, 40, 63, 28, },
{ 4, 65, 47, 19, },
{ 14, 53, 26, 11, },
{ 26, 23, 37, 16, },
{ 28, 14, 35, 15, },
{ 26, 12, 31, 13, },
{ 20, 15, 44, 17, },
{ 12, 16, 41, 15, },
{ 12, 15, 43, 20, },
{ 11, 14, 52, 25, },
{ 11, 17, 46, 18, },
{ 11, 16, 44, 17, },
{ 11, 13, 51, 21, },
{ 11, 14, 41, 18, },
{ 11, 18, 31, 12, },
{ 12, 20, 27, 12, },
{ 11, 19, 25, 13, },
{ 12, 16, 41, 18, },
{ 12, 15, 48, 19, },
{ 11, 17, 37, 15, },
{ 11, 19, 26, 10, },
{ 11, 19, 22, 9, },
{ 12, 19, 24, 18, },
{ 11, 22, 43, 43, },
{ 5, 15, 55, 50, },
{ 0, 12, 58, 37, },
{ 0, 10, 44, 29, },
{ 0, 9, 37, 25, },
{ 0, 9, 38, 24, },
{ 0, 12, 34, 22, },
{ 0, 9, 26, 21, },
{ 0, 5, 19, 18, },
{ 0, 4, 15, 13, },
{ 0, 18, 37, 17, },
{ 2, 52, 65, 23, },
{ 5, 67, 36, 18, },
{ 17, 42, 22, 17, },
{ 26, 20, 23, 15, },
{ 26, 12, 21, 15, },
{ 24, 11, 23, 17, },
{ 16, 16, 29, 19, },
{ 12, 14, 29, 23, },
{ 11, 13, 26, 20, },
{ 11, 15, 25, 13, },
{ 11, 16, 21, 11, },
{ 11, 16, 22, 10, },
{ 10, 16, 39, 15, },
{ 11, 14, 40, 19, },
{ 10, 14, 41, 25, },
{ 10, 13, 42, 29, },
{ 11, 12, 44, 24, },
{ 11, 13, 43, 25, },
{ 10, 15, 47, 31, },
{ 10, 14, 55, 29, },
{ 9, 15, 56, 26, },
{ 10, 18, 50, 27, },
{ 11, 33, 71, 28, },
{ 9, 62, 57, 25, },
{ 11, 56, 32, 24, },
{ 20, 28, 31, 23, },
{ 24, 16, 32, 22, },
{ 23, 15, 28, 15, },
{ 21, 18, 24, 14, },
{ 10, 21, 33, 24, },
{ 3, 20, 38, 27, },
{ 2, 21, 37, 26, },
{ 3, 24, 32, 23, },
{ 3, 37, 53, 24, },
{ 4, 55, 69, 39, },
{ 8, 49, 41, 40, },
{ 18, 29, 33, 29, },
{ 15, 18, 37, 23, },
{ 5, 12, 43, 26, },
{ 3, 14, 45, 27, },
{ 4, 15, 47, 28, },
{ 4, 16, 44, 31, },
{ 4, 18, 42, 27, },
{ 5, 19, 37, 18, },
{ 5, 28, 51, 21, },
{ 4, 56, 69, 28, },
{ 6, 65, 41, 19, },
{ 18, 40, 30, 22, },
{ 20, 31, 55, 30, },
{ 9, 55, 64, 28, },
{ 10, 52, 39, 21, },
{ 18, 29, 36, 23, },
{ 14, 38, 59, 30, },
{ 7, 60, 56, 26, },
{ 12, 51, 29, 17, },
{ 20, 29, 30, 18, },
{ 17, 41, 64, 29, },
{ 6, 63, 54, 31, },
{ 13, 49, 38, 31, },
{ 23, 24, 36, 30, },
{ 24, 16, 40, 30, },
{ 22, 10, 42, 27, },
{ 18, 15, 46, 27, },
{ 10, 13, 48, 30, },
{ 10, 11, 47, 34, },
{ 10, 12, 51, 36, },
{ 10, 13, 57, 35, },
{ 9, 14, 56, 31, },
{ 9, 16, 42, 27, },
{ 10, 17, 34, 24, },
{ 9, 14, 34, 23, },
{ 9, 13, 35, 23, },
{ 10, 13, 35, 23, },
{ 10, 13, 34, 23, },
{ 10, 13, 32, 21, },
{ 10, 14, 30, 22, },
{ 10, 15, 33, 25, },
{ 10, 18, 36, 27, },
{ 10, 20, 36, 31, },
{ 9, 21, 49, 50, },
{ 4, 13, 60, 51, },
{ 0, 10, 50, 35, },
{ 0, 10, 38, 23, },
{ 0, 9, 33, 21, },
{ 0, 10, 25, 20, },
{ 0, 12, 20, 17, },
{ 0, 8, 16, 13, },
{ 0, 5, 19, 13, },
{ 0, 5, 28, 14, },
{ 0, 15, 46, 18, },
{ 2, 44, 61, 23, },
{ 5, 59, 36, 15, },
{ 17, 42, 19, 11, },
{ 27, 21, 13, 8, },
{ 28, 15, 14, 8, },
{ 24, 12, 20, 12, },
{ 15, 14, 23, 13, },
{ 10, 12, 31, 13, },
{ 10, 11, 31, 13, },
{ 11, 13, 25, 13, },
{ 10, 17, 21, 10, },
{ 10, 16, 18, 7, },
{ 10, 14, 19, 10, },
{ 10, 13, 27, 12, },
{ 10, 13, 34, 17, },
{ 10, 14, 44, 19, },
{ 10, 13, 47, 21, },
{ 10, 13, 46, 20, },
{ 11, 12, 50, 18, },
{ 10, 12, 52, 18, },
{ 10, 13, 51, 19, },
{ 10, 13, 48, 19, },
{ 10, 30, 67, 22, },
{ 8, 59, 58, 18, },
{ 10, 54, 40, 13, },
{ 22, 27, 32, 13, },
{ 25, 14, 29, 13, },
{ 24, 11, 26, 13, },
{ 21, 13, 25, 13, },
{ 11, 14, 34, 16, },
{ 10, 12, 36, 16, },
{ 10, 12, 34, 15, },
{ 10, 16, 29, 14, },
{ 10, 19, 27, 19, },
{ 9, 25, 45, 42, },
{ 3, 19, 46, 48, },
{ 1, 12, 37, 35, },
{ 0, 11, 29, 23, },
{ 0, 9, 29, 20, },
{ 0, 9, 27, 18, },
{ 0, 9, 23, 17, },
{ 0, 5, 20, 20, },
{ 0, 4, 20, 18, },
{ 0, 4, 18, 14, },
{ 0, 15, 32, 16, },
{ 1, 46, 57, 24, },
{ 7, 56, 42, 17, },
{ 15, 37, 32, 13, },
{ 21, 21, 31, 12, },
{ 21, 14, 36, 12, },
{ 21, 13, 34, 14, },
{ 14, 19, 37, 17, },
{ 3, 20, 36, 18, },
{ 0, 22, 35, 17, },
{ 0, 23, 30, 15, },
{ 0, 28, 34, 14, },
{ 1, 53, 64, 30, },
{ 3, 67, 56, 32, },
{ 13, 49, 42, 30, },
{ 23, 22, 42, 28, },
{ 26, 12, 40, 25, },
{ 24, 8, 44, 25, },
{ 19, 13, 47, 27, },
{ 11, 13, 42, 20, },
{ 11, 10, 40, 18, },
{ 10, 12, 41, 18, },
{ 10, 12, 44, 16, },
{ 10, 11, 36, 16, },
{ 10, 12, 33, 19, },
{ 10, 13, 44, 24, },
{ 10, 13, 48, 23, },
{ 9, 12, 44, 24, },
{ 9, 12, 43, 28, },
{ 10, 15, 45, 25, },
{ 11, 17, 40, 24, },
{ 10, 15, 35, 31, },
{ 11, 14, 34, 32, },
{ 10, 12, 37, 25, },
{ 11, 14, 37, 23, },
{ 10, 19, 52, 44, },
{ 4, 13, 63, 48, },
{ 0, 11, 52, 35, },
{ 0, 10, 42, 26, },
{ 0, 13, 36, 24, },
{ 0, 12, 28, 20, },
{ 0, 10, 34, 21, },
{ 0, 6, 39, 21, },
{ 0, 2, 35, 21, },
{ 0, 5, 33, 20, },
{ 0, 17, 41, 21, },
{ 2, 47, 60, 20, },
{ 5, 62, 37, 14, },
{ 16, 41, 23, 17, },
{ 24, 20, 26, 17, },
{ 25, 11, 29, 15, },
{ 23, 9, 28, 16, },
{ 16, 13, 27, 19, },
{ 12, 11, 30, 20, },
{ 10, 12, 33, 19, },
{ 11, 13, 33, 19, },
{ 11, 15, 32, 20, },
{ 10, 15, 30, 22, },
{ 10, 19, 37, 25, },
{ 10, 24, 57, 24, },
{ 10, 19, 54, 23, },
{ 9, 17, 54, 20, },
{ 10, 13, 55, 24, },
{ 9, 15, 55, 28, },
{ 10, 19, 65, 28, },
{ 9, 19, 69, 27, },
{ 10, 17, 56, 26, },
{ 10, 19, 52, 23, },
{ 10, 32, 71, 24, },
{ 9, 57, 65, 20, },
{ 12, 50, 48, 17, },
{ 18, 23, 44, 17, },
{ 21, 15, 39, 18, },
{ 20, 13, 37, 19, },
{ 17, 13, 40, 19, },
{ 8, 11, 45, 19, },
{ 0, 8, 46, 22, },
{ 0, 8, 44, 22, },
{ 0, 5, 42, 20, },
{ 0, 8, 40, 27, },
{ 0, 13, 50, 45, },
{ 0, 14, 54, 50, },
{ 0, 12, 55, 40, },
{ 0, 13, 57, 32, },
{ 0, 14, 53, 31, },
{ 0, 35, 71, 33, },
{ 4, 59, 62, 26, },
{ 12, 46, 39, 22, },
{ 19, 22, 38, 22, },
{ 22, 16, 37, 22, },
{ 21, 14, 37, 21, },
{ 17, 17, 34, 19, },
{ 7, 17, 38, 26, },
{ 0, 11, 50, 33, },
{ 0, 8, 55, 36, },
{ 0, 9, 54, 35, },
{ 0, 11, 50, 32, },
{ 0, 13, 54, 32, },
{ 0, 11, 62, 37, },
{ 0, 10, 58, 33, },
{ 0, 11, 53, 30, },
{ 0, 13, 44, 31, },
{ 0, 34, 42, 34, },
{ 2, 47, 33, 24, },
{ 5, 34, 30, 16, },
{ 5, 22, 32, 15, },
{ 7, 19, 33, 15, },
{ 6, 19, 31, 15, },
{ 3, 17, 36, 14, },
{ 2, 14, 35, 15, },
{ 3, 14, 35, 15, },
{ 3, 13, 35, 15, },
{ 2, 13, 35, 18, },
{ 1, 12, 35, 17, },
{ 2, 13, 28, 13, },
{ 1, 11, 27, 13, },
{ 2, 8, 29, 14, },
{ 1, 9, 28, 14, },
{ 3, 11, 24, 15, },
{ 3, 10, 22, 14, },
{ 2, 10, 21, 12, },
{ 1, 10, 23, 11, },
{ 1, 11, 22, 12, },
{ 1, 9, 19, 11, },
{ 1, 9, 20, 10, },
{ 1, 9, 19, 10, },
{ 2, 11, 18, 9, },
{ 2, 10, 18, 10, },
{ 0, 9, 18, 9, },
{ 0, 10, 19, 9, },
{ 0, 13, 19, 8, },
{ 0, 12, 21, 9, },
{ 1, 8, 20, 9, },
{ 1, 7, 17, 9, },
{ 1, 9, 16, 8, },
{ 1, 9, 15, 8, },
{ 1, 9, 15, 7, },
{ 0, 7, 15, 6, },
{ 0, 9, 15, 7, },
{ 1, 8, 12, 6, },
{ 0, 6, 11, 5, },
{ 0, 6, 12, 5, },
{ 0, 6, 12, 5, },
{ 0, 5, 13, 4, },
{ 0, 3, 12, 4, },
{ 0, 3, 10, 3, },
{ 0, 3, 8, 3, },
{ 0, 3, 8, 3, },
{ 0, 3, 7, 3, },
{ 0, 3, 7, 2, },
{ 0, 2, 5, 2, },
{ 0, 2, 4, 2, },
{ 0, 1, 4, 1, },
{ 0, 1, 4, 1, },
{ 0, 1, 3, 1, },
{ 0, 0, 2, 1, },
{ 0, 0, 1, 0, },
{ 0, 0, 1, 0, },
{ 0, 0, 0, 0, },
{ 0, 0, 0, 0, },
};
/**
* @file lv_demo_music.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_demo_music.h"
#if LV_USE_DEMO_MUSIC
#include "lv_demo_music_main.h"
#include "lv_demo_music_list.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
#if LV_DEMO_MUSIC_AUTO_PLAY
static void auto_step_cb(lv_timer_t * timer);
#endif
/**********************
* STATIC VARIABLES
**********************/
static lv_obj_t * ctrl;
static lv_obj_t * list;
static const char * title_list[] = {
"Waiting for true love",
"Need a Better Future",
"Vibrations",
"Why now?",
"Never Look Back",
"It happened Yesterday",
"Feeling so High",
"Go Deeper",
"Find You There",
"Until the End",
"Unknown",
"Unknown",
"Unknown",
"Unknown",
};
static const char * artist_list[] = {
"The John Smith Band",
"My True Name",
"Robotics",
"John Smith",
"My True Name",
"Robotics",
"Robotics",
"Unknown artist",
"Unknown artist",
"Unknown artist",
"Unknown artist",
"Unknown artist",
"Unknown artist",
"Unknown artist",
"Unknown artist",
};
static const char * genre_list[] = {
"Rock • 1997",
"Drum'n bass • 2016",
"Psy trance • 2020",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
"Metal • 2015",
};
static const uint32_t time_list[] = {
1*60 + 14,
2*60 + 26,
1*60 + 54,
2*60 + 24,
2*60 + 37,
3*60 + 33,
1*60 + 56,
3*60 + 31,
2*60 + 20,
2*60 + 19,
2*60 + 20,
2*60 + 19,
2*60 + 20,
2*60 + 19,
};
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_demo_music(void)
{
lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x343247), 0);
list = _lv_demo_music_list_create(lv_scr_act());
ctrl = _lv_demo_music_main_create(lv_scr_act());
#if LV_DEMO_MUSIC_AUTO_PLAY
lv_timer_create(auto_step_cb, 1000, NULL);
#endif
}
const char * _lv_demo_music_get_title(uint32_t track_id)
{
if(track_id >= sizeof(title_list) / sizeof(title_list[0])) return NULL;
return title_list[track_id];
}
const char * _lv_demo_music_get_artist(uint32_t track_id)
{
if(track_id >= sizeof(artist_list) / sizeof(artist_list[0])) return NULL;
return artist_list[track_id];
}
const char * _lv_demo_music_get_genre(uint32_t track_id)
{
if(track_id >= sizeof(genre_list) / sizeof(genre_list[0])) return NULL;
return genre_list[track_id];
}
uint32_t _lv_demo_music_get_track_length(uint32_t track_id)
{
if(track_id >= sizeof(time_list) / sizeof(time_list[0])) return 0;
return time_list[track_id];
}
/**********************
* STATIC FUNCTIONS
**********************/
#if LV_DEMO_MUSIC_AUTO_PLAY
static void auto_step_cb(lv_timer_t * t)
{
LV_UNUSED(t);
static uint32_t state = 0;
#if LV_DEMO_MUSIC_LARGE
const lv_font_t * font_small = &lv_font_montserrat_22;
const lv_font_t * font_large = &lv_font_montserrat_32;
#else
const lv_font_t * font_small = &lv_font_montserrat_12;
const lv_font_t * font_large = &lv_font_montserrat_16;
#endif
switch(state) {
case 5:
_lv_demo_music_album_next(true);
break;
case 6:
_lv_demo_music_album_next(true);
break;
case 7:
_lv_demo_music_album_next(true);
break;
case 8:
_lv_demo_music_play(0);
break;
#if LV_DEMO_MUSIC_SQUARE || LV_DEMO_MUSIC_ROUND
case 11:
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
break;
case 13:
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
break;
#else
case 12:
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
break;
#endif
case 15:
lv_obj_scroll_by(list, 0, -300, LV_ANIM_ON);
break;
case 16:
lv_obj_scroll_by(list, 0, 300, LV_ANIM_ON);
break;
case 18:
_lv_demo_music_play(1);
break;
case 19:
lv_obj_scroll_by(ctrl, 0, LV_VER_RES, LV_ANIM_ON);
break;
#if LV_DEMO_MUSIC_SQUARE || LV_DEMO_MUSIC_ROUND
case 20:
lv_obj_scroll_by(ctrl, 0, LV_VER_RES, LV_ANIM_ON);
break;
#endif
case 30:
_lv_demo_music_play(2);
break;
case 40: {
lv_obj_t * bg = lv_layer_top();
lv_obj_set_style_bg_color(bg, lv_color_hex(0x6f8af6), 0);
lv_obj_set_style_text_color(bg, lv_color_white(), 0);
lv_obj_set_style_bg_opa(bg, LV_OPA_COVER, 0);
lv_obj_fade_in(bg, 400, 0);
lv_obj_t * dsc = lv_label_create(bg);
lv_obj_set_style_text_font(dsc, font_small, 0);
lv_label_set_text(dsc, "The average FPS is");
lv_obj_align(dsc, LV_ALIGN_TOP_MID, 0, 90);
lv_obj_t * num = lv_label_create(bg);
lv_obj_set_style_text_font(num, font_large, 0);
#if LV_USE_PERF_MONITOR
lv_label_set_text_fmt(num, "%d", lv_refr_get_fps_avg());
#endif
lv_obj_align(num, LV_ALIGN_TOP_MID, 0, 120);
lv_obj_t * attr = lv_label_create(bg);
lv_obj_set_style_text_align(attr, LV_TEXT_ALIGN_CENTER, 0);
lv_obj_set_style_text_font(attr, font_small, 0);
#if LV_DEMO_MUSIC_SQUARE || LV_DEMO_MUSIC_ROUND
lv_label_set_text(attr, "Copyright 2020 LVGL Kft.\nwww.lvgl.io | lvgl@lvgl.io");
#else
lv_label_set_text(attr, "Copyright 2020 LVGL Kft. | www.lvgl.io | lvgl@lvgl.io");
#endif
lv_obj_align(attr, LV_ALIGN_BOTTOM_MID, 0, -10);
break;
}
case 41:
lv_scr_load(lv_obj_create(NULL));
_lv_demo_music_pause();
break;
}
state++;
}
#endif /*LV_DEMO_MUSIC_AUTO_PLAY*/
#endif /*LV_USE_DEMO_MUSIC*/
/**
* @file lv_demo_music.h
*
*/
#ifndef LV_DEMO_MUSIC_H
#define LV_DEMO_MUSIC_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../../lv_demo.h"
#if LV_USE_DEMO_MUSIC
/*********************
* DEFINES
*********************/
#if LV_DEMO_MUSIC_LARGE
# define LV_DEMO_MUSIC_HANDLE_SIZE 40
#else
# define LV_DEMO_MUSIC_HANDLE_SIZE 20
#endif
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_demo_music(void);
const char * _lv_demo_music_get_title(uint32_t track_id);
const char * _lv_demo_music_get_artist(uint32_t track_id);
const char * _lv_demo_music_get_genre(uint32_t track_id);
uint32_t _lv_demo_music_get_track_length(uint32_t track_id);
/**********************
* MACROS
**********************/
#endif /*LV_USE_DEMO_MUSIC*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_DEMO_MUSIC_H*/
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -3,4 +3,4 @@ if exist sd.bin goto run
qemu-img create -f raw sd.bin 64M
:run
qemu-system-arm -M vexpress-a9 -smp cpus=2 -kernel rtthread.bin -serial stdio -sd sd.bin
qemu-system-arm -M vexpress-a9 -smp cpus=2 -kernel rtthread.bin -serial stdio -sd sd.bin -show-cursor
此差异已折叠。
此差异已折叠。
......@@ -16,8 +16,12 @@
#include "drv_usart_v2.h"
#else
#include "drv_usart.h"
#endif
#endif
#endif /* RT_USING_SERIAL */
#endif /* RT_USING_SERIAL_V2 */
#define DBG_TAG "drv_common"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
#ifdef RT_USING_FINSH
#include <finsh.h>
......@@ -115,6 +119,7 @@ void _Error_Handler(char *s, int num)
{
/* USER CODE BEGIN Error_Handler */
/* User can add his own implementation to report the HAL error return state */
LOG_E("Error_Handler at file:%s num:%d", s, num);
while (1)
{
}
......
......@@ -65,21 +65,21 @@ static rt_err_t set_rtc_time_stamp(time_t time_stamp)
{
RTC_TimeTypeDef RTC_TimeStruct = {0};
RTC_DateTypeDef RTC_DateStruct = {0};
struct tm p_tm = {0};
struct tm tm = {0};
gmtime_r(&time_stamp, &p_tm);
if (p_tm.tm_year < 100)
gmtime_r(&time_stamp, &tm);
if (tm.tm_year < 100)
{
return -RT_ERROR;
}
RTC_TimeStruct.Seconds = p_tm.tm_sec ;
RTC_TimeStruct.Minutes = p_tm.tm_min ;
RTC_TimeStruct.Hours = p_tm.tm_hour;
RTC_DateStruct.Date = p_tm.tm_mday;
RTC_DateStruct.Month = p_tm.tm_mon + 1 ;
RTC_DateStruct.Year = p_tm.tm_year - 100;
RTC_DateStruct.WeekDay = p_tm.tm_wday + 1;
RTC_TimeStruct.Seconds = tm.tm_sec ;
RTC_TimeStruct.Minutes = tm.tm_min ;
RTC_TimeStruct.Hours = tm.tm_hour;
RTC_DateStruct.Date = tm.tm_mday;
RTC_DateStruct.Month = tm.tm_mon + 1 ;
RTC_DateStruct.Year = tm.tm_year - 100;
RTC_DateStruct.WeekDay = tm.tm_wday + 1;
if (HAL_RTC_SetTime(&RTC_Handler, &RTC_TimeStruct, RTC_FORMAT_BIN) != HAL_OK)
{
......
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
dir_path:
- CubeMX_Config
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
dir_path:
- CubeMX_Config
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
dir_path:
- CubeMX_Config
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
dir_path:
- CubeMX_Config
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册