除了显示驱动,其余全部测试通过
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
#ifndef APP_CONFIG_H
|
||||
#define APP_CONFIG_H
|
||||
|
||||
/* WiFi配置 */
|
||||
#define CONFIG_WIFI_ENABLE
|
||||
|
||||
#ifdef CONFIG_NO_SDRAM_ENABLE
|
||||
#define CONFIG_RF_TRIM_CODE_MOVABLE
|
||||
#else
|
||||
#define CONFIG_RF_TRIM_CODE_AT_RAM
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* AC7911BB 存储容量 */
|
||||
#define __FLASH_SIZE__ (16 * 1024 * 1024)
|
||||
#define __SDRAM_SIZE__ (8 * 1024 * 1024)
|
||||
|
||||
/* 电源配置 */
|
||||
#define TCFG_LOWPOWER_BTOSC_DISABLE 0
|
||||
#define TCFG_LOWPOWER_LOWPOWER_SEL 0//(RF_SLEEP_EN|RF_FORCE_SYS_SLEEP_EN|SYS_SLEEP_EN) //该宏在睡眠低功耗才用到,此处设置为0
|
||||
#define TCFG_LOWPOWER_VDDIOM_LEVEL VDDIOM_VOL_32V //正常工作的内部vddio电压值,一般使用外部3.3V,内部设置需比外部3.3V小
|
||||
#ifdef CONFIG_RTC_ENABLE
|
||||
#define TCFG_LOWPOWER_VDDIOW_LEVEL VDDIOW_VOL_32V //弱VDDIO电压档位。RTCVDD电压低于3.2V可能不走时,因此RTCVDD由IOVDD供电时,VDDIOW应设置为VDDIOW_VOL_32V档
|
||||
#else
|
||||
#define TCFG_LOWPOWER_VDDIOW_LEVEL VDDIOW_VOL_21V //弱VDDIO电压档位
|
||||
#endif
|
||||
#define VDC14_VOL_SEL_LEVEL VDC14_VOL_SEL_140V //内部的1.4V默认1.4V
|
||||
#define SYSVDD_VOL_SEL_LEVEL SYSVDD_VOL_SEL_126V //系统内核电压,默认1.26V
|
||||
|
||||
/* C++程序识别开关 */
|
||||
#define CONFIG_CXX_SUPPORT //使能C++支持
|
||||
|
||||
/* 调试开关 */
|
||||
#define CONFIG_USER_DEBUG_ENABLE // 保留 user_printf 业务日志
|
||||
#define CONFIG_SYS_DEBUG_DISABLE // 关闭 SDK 和普通 printf 日志
|
||||
#define CONFIG_DEBUG_ENABLE // 串口打印调试:printf()、puts()、log_print()正常输出
|
||||
//#define SDTAP_DEBUG // JTAG/SWD调试
|
||||
#define CONFIG_LIB_DEBUG_DISABLE // 关闭 SDK 库 Tag 日志
|
||||
|
||||
#define CONFIG_APP_LOG_ENABLE 1 // JL-AIBT-SoundBox 业务日志总开关
|
||||
|
||||
#if !defined CONFIG_DEBUG_ENABLE || defined CONFIG_LIB_DEBUG_DISABLE
|
||||
#define LIB_DEBUG 0
|
||||
#else
|
||||
#define LIB_DEBUG 1
|
||||
#endif
|
||||
#define CONFIG_DEBUG_LIB(x) (x & LIB_DEBUG)
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef APP_LOG_H
|
||||
#define APP_LOG_H
|
||||
|
||||
#include "app_config.h"
|
||||
#include "system/generic/printf.h"
|
||||
|
||||
/*
|
||||
* APP_LOG 使用独立的 user_printf 输出。
|
||||
* 这样关闭 SDK printf 后,仍可保留 JL-AIBT-SoundBox 自己的日志。
|
||||
*/
|
||||
#if defined(CONFIG_USER_DEBUG_ENABLE) && \
|
||||
defined(CONFIG_APP_LOG_ENABLE) && \
|
||||
CONFIG_APP_LOG_ENABLE
|
||||
|
||||
#define APP_LOG(...) user_printf(__VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
#define APP_LOG(...) do { } while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,90 @@
|
||||
#include "app_config.h"
|
||||
#include "system/includes.h"
|
||||
#include "os/os_api.h"
|
||||
|
||||
#include "app_log.h"
|
||||
#include "wifi_manager.h"
|
||||
#include "audio_test.h"
|
||||
#include "led.h"
|
||||
#include "mqtt_config.h"
|
||||
#include "mqtt_manager.h"
|
||||
|
||||
|
||||
//#define WIFI_TEST_PASSWORD "12345678"
|
||||
//#define WIFI_TEST_SSID "JLTEST24"
|
||||
//#define WIFI_TEST_PASSWORD "12345678"
|
||||
#define WIFI_TEST_SSID "超导体"
|
||||
#define WIFI_TEST_PASSWORD "12345678"
|
||||
/*
|
||||
* MQTT测试回调
|
||||
*
|
||||
* 接收服务器下发消息
|
||||
*/
|
||||
static void mqtt_message_handler(const char *topic,
|
||||
const uint8_t *payload,uint32_t len)
|
||||
{
|
||||
APP_LOG("\n======== MQTT RX ========\n");
|
||||
APP_LOG("topic:%s\n", topic);
|
||||
APP_LOG(
|
||||
"payload:%.*s\n",
|
||||
len,
|
||||
payload
|
||||
);
|
||||
APP_LOG("=========================\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* wifi任务
|
||||
*/
|
||||
static void wifi_connect_task(void *arg)
|
||||
{
|
||||
int msg[4];
|
||||
os_taskq_pend("taskq",msg,ARRAY_SIZE(msg));
|
||||
const char *ssid = (const char *)msg[1];
|
||||
const char *password = (const char *)msg[2];
|
||||
APP_LOG("ssid=%s,password=%s\n",ssid,password);
|
||||
wifi_manager_connect(ssid,password);
|
||||
os_time_dly(1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* AC79入口
|
||||
*/
|
||||
void app_main(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
led_init();
|
||||
APP_LOG("===START===\n");
|
||||
wifi_manager_init();
|
||||
|
||||
//mqtt_manager_set_callback(mqtt_message_handler);
|
||||
|
||||
|
||||
thread_fork
|
||||
(
|
||||
"wifi_connect_task",
|
||||
9,
|
||||
2048,
|
||||
16,
|
||||
NULL,
|
||||
wifi_connect_task,
|
||||
NULL
|
||||
);
|
||||
|
||||
os_taskq_post(
|
||||
"wifi_connect_task",
|
||||
2,
|
||||
(int)WIFI_TEST_SSID,
|
||||
(int)WIFI_TEST_PASSWORD
|
||||
);
|
||||
mqtt_manager_init();
|
||||
mqtt_manager_start();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "app_config.h"
|
||||
#include "irq_task_config.h"
|
||||
|
||||
/*中断列表 */
|
||||
const struct irq_info irq_info_table[] = {
|
||||
//中断号 //优先级0-7 //注册的cpu(0或1)
|
||||
#ifdef CONFIG_IPMASK_ENABLE
|
||||
//不可屏蔽中断方法:支持写flash,但中断函数和调用函数和const要全部放在内部ram
|
||||
{ IRQ_SOFT5_IDX, 6, 0 }, //此中断强制注册到cpu0
|
||||
{ IRQ_SOFT4_IDX, 6, 1 }, //此中断强制注册到cpu1
|
||||
#if 0 //如下,SPI1使用不可屏蔽中断设置,优先级固定7
|
||||
{ IRQ_SPI1_IDX, 7, 1 },//中断强制注册到cpu0/1
|
||||
#endif
|
||||
#endif
|
||||
#if CPU_CORE_NUM == 1
|
||||
{ IRQ_SOFT5_IDX, 7, 0 }, //此中断强制注册到cpu0
|
||||
{ IRQ_SOFT4_IDX, 7, 1 }, //此中断强制注册到cpu1
|
||||
{ -2, -2, -2 },//如果加入了该行, 那么只有该行之前的中断注册到对应核, 其他所有中断强制注册到CPU0
|
||||
#endif
|
||||
|
||||
{ -1, -1, -1 },
|
||||
};
|
||||
|
||||
/*任务列表 */
|
||||
const struct task_info task_info_table[] = {
|
||||
{"app_core", 15, 2048, 1024 },
|
||||
{"sys_event", 29, 512, 0 },
|
||||
{"systimer", 14, 256, 0 },
|
||||
{"sys_timer", 9, 512, 128 },
|
||||
|
||||
/* 音频服务任务(audio_server + audio_encoder) */
|
||||
{"audio_server", 16, 512, 64 },
|
||||
{"audio_encoder", 12, 384, 64 },
|
||||
|
||||
{"tcpip_thread", 16, 800, 0},
|
||||
|
||||
#ifdef CONFIG_WIFI_ENABLE
|
||||
{"tasklet", 10, 1400, 0},
|
||||
{"RtmpMlmeTask", 17, 700, 0},
|
||||
{"RtmpCmdQTask", 17, 300, 0},
|
||||
{"wl_rx_irq_thread", 5, 256, 0},
|
||||
#endif
|
||||
|
||||
{0, 0, 0, 0, 0},
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef IRQ_TASK_CONFIG_H
|
||||
#define IRQ_TASK_CONFIG_H
|
||||
|
||||
#include "system/includes.h"
|
||||
|
||||
extern const struct irq_info irq_info_table[];
|
||||
extern const struct task_info task_info_table[];
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user