增加了蓝牙音量控制
This commit is contained in:
parent
bace157a54
commit
9ce296cba1
@ -17,7 +17,6 @@
|
|||||||
#include "app_voice_player.h"
|
#include "app_voice_player.h"
|
||||||
#include "BkDriverFlash.h"
|
#include "BkDriverFlash.h"
|
||||||
#include "manual_ps_pub.h"
|
#include "manual_ps_pub.h"
|
||||||
|
|
||||||
#ifdef PKG_USING_EASYFLASH
|
#ifdef PKG_USING_EASYFLASH
|
||||||
#include "easyflash.h"
|
#include "easyflash.h"
|
||||||
|
|
||||||
@ -27,7 +26,6 @@
|
|||||||
#include "saradc_pub.h"
|
#include "saradc_pub.h"
|
||||||
|
|
||||||
#include "ring_queue.h"
|
#include "ring_queue.h"
|
||||||
#include "opus_encoder.h"
|
|
||||||
#include "charge.h"
|
#include "charge.h"
|
||||||
#include "mqtt_client.h"
|
#include "mqtt_client.h"
|
||||||
|
|
||||||
@ -41,8 +39,9 @@ static beken_timer_t timer_hall_detect;
|
|||||||
static beken_timer_t timer_poweroff;
|
static beken_timer_t timer_poweroff;
|
||||||
static beken_timer_t timer_bind;
|
static beken_timer_t timer_bind;
|
||||||
static beken_timer_t timer_idle;
|
static beken_timer_t timer_idle;
|
||||||
static beken_timer_t timer_battery_refresh ;
|
static beken_timer_t timer_battery_refresh;
|
||||||
//static beken_timer_t timer_charge_hell ;
|
static beken_timer_t timer_ble_scan;
|
||||||
|
static beken_timer_t timer_charge_hell ;
|
||||||
|
|
||||||
int start_bind_detect = 0;
|
int start_bind_detect = 0;
|
||||||
int hall_key_down_count = 0;
|
int hall_key_down_count = 0;
|
||||||
@ -137,6 +136,7 @@ int temperature_adv_get_name(recv_adv_t *r_ind,char *name){
|
|||||||
}
|
}
|
||||||
return name_len;
|
return name_len;
|
||||||
}
|
}
|
||||||
|
void timer_ble_scan_callback(void *arg);
|
||||||
/**
|
/**
|
||||||
* 搜索广播回调
|
* 搜索广播回调
|
||||||
*/
|
*/
|
||||||
@ -201,6 +201,12 @@ void temperature_adv_callback(recv_adv_t *r_ind)
|
|||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
bk_printf("same : %s \r\n",str_current);
|
bk_printf("same : %s \r\n",str_current);
|
||||||
|
if(0){//box_info.charge_state == 0){
|
||||||
|
belon_ble_scan_stop();
|
||||||
|
rtos_init_timer(&timer_ble_scan, BLE_SCAN_INTERVAL, timer_ble_scan_callback, NULL);
|
||||||
|
rtos_start_timer(&timer_ble_scan);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//int i;
|
//int i;
|
||||||
@ -405,6 +411,8 @@ void timer_check_device_run_callback(void *arg){
|
|||||||
}
|
}
|
||||||
//rtos_start_timer(&timer_poweroff);
|
//rtos_start_timer(&timer_poweroff);
|
||||||
box_poweroff_timeout_callback(NULL);
|
box_poweroff_timeout_callback(NULL);
|
||||||
|
|
||||||
|
|
||||||
//合盖状态接入充电 ---> 关机
|
//合盖状态接入充电 ---> 关机
|
||||||
// if (box_info.hall_state == 0)
|
// if (box_info.hall_state == 0)
|
||||||
// {
|
// {
|
||||||
@ -418,6 +426,11 @@ void timer_check_device_run_callback(void *arg){
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void timer_ble_scan_callback(void *arg){
|
||||||
|
//belon_ble_scan_start();
|
||||||
|
//rtos_deinit_timer(&timer_ble_scan);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示 ... 表示等待
|
* 显示 ... 表示等待
|
||||||
*/
|
*/
|
||||||
@ -441,15 +454,15 @@ static void app_temperature_ui_wait_entry(void *parameter)
|
|||||||
ui_wait_step =1;
|
ui_wait_step =1;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
OLED_ShowString(0+20,0,(u8 *)".",32,1);
|
OLED_ShowString(16,0,(u8 *)".",32,1);
|
||||||
ui_wait_step =2;
|
ui_wait_step =2;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
OLED_ShowString(0+20,0,(u8 *)"..",32,1);
|
OLED_ShowString(16,0,(u8 *)"..",32,1);
|
||||||
ui_wait_step =3;
|
ui_wait_step =3;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
OLED_ShowString(0+20,0,(u8 *)"...",32,1);
|
OLED_ShowString(16,0,(u8 *)"...",32,1);
|
||||||
ui_wait_step =0;
|
ui_wait_step =0;
|
||||||
break;
|
break;
|
||||||
break;
|
break;
|
||||||
@ -501,30 +514,30 @@ static void box_adc_detect_callback(int new_mv, void *user_data)
|
|||||||
bat_volt -= 48 ;
|
bat_volt -= 48 ;
|
||||||
}
|
}
|
||||||
rt_kprintf("battery_calc --> bat_volt:%d\n",bat_volt);
|
rt_kprintf("battery_calc --> bat_volt:%d\n",bat_volt);
|
||||||
if(bat_volt >= batt_max)
|
if(bat_volt >= batt_max)
|
||||||
box_battery_percent = 100;
|
box_battery_percent = 100;
|
||||||
else if(bat_volt <= batt_max && bat_volt >= 4000){
|
else if(bat_volt <= batt_max && bat_volt >= 4000){
|
||||||
kmah = (-28880*bat_volt+120895600)/151;
|
kmah = (-28880*bat_volt+120895600)/151;
|
||||||
box_battery_percent = (443570-kmah)*100/443570; // 4000~4150
|
box_battery_percent = (443570-kmah)*100/443570; // 4000~4150
|
||||||
}
|
}
|
||||||
else if(bat_volt <= 4000 && bat_volt >= 3800){
|
else if(bat_volt <= 4000 && bat_volt >= 3800){
|
||||||
kmah = (-78560*bat_volt+321360000)/200;
|
kmah = (-78560*bat_volt+321360000)/200;
|
||||||
box_battery_percent = (443570-kmah)*100/443570; // 3800~4000
|
box_battery_percent = (443570-kmah)*100/443570; // 3800~4000
|
||||||
}
|
}
|
||||||
else if(bat_volt <= 3800 && bat_volt >= 3600){
|
else if(bat_volt <= 3800 && bat_volt >= 3600){
|
||||||
kmah = (-134960*bat_volt+535680000)/200;
|
kmah = (-134960*bat_volt+535680000)/200;
|
||||||
box_battery_percent = (443570-kmah)*100/443570; // 3600~3800
|
box_battery_percent = (443570-kmah)*100/443570; // 3600~3800
|
||||||
}
|
}
|
||||||
else if(bat_volt <= 3600 && bat_volt >= 3400){
|
else if(bat_volt <= 3600 && bat_volt >= 3400){
|
||||||
kmah = (-163110*bat_volt+637020000)/200;
|
kmah = (-163110*bat_volt+637020000)/200;
|
||||||
box_battery_percent = (443570-kmah)*100/443570; // 3400~3600
|
box_battery_percent = (443570-kmah)*100/443570; // 3400~3600
|
||||||
}
|
}
|
||||||
else if(bat_volt <= 3600 && bat_volt >= 3400){
|
else if(bat_volt <= 3600 && bat_volt >= 3400){
|
||||||
kmah = (-31340*bat_volt+271448000)/400;
|
kmah = (-31340*bat_volt+271448000)/400;
|
||||||
box_battery_percent = (443570-kmah)*100/443570; // 3000~3400
|
box_battery_percent = (443570-kmah)*100/443570; // 3000~3400
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
box_battery_percent = 1;
|
box_battery_percent = 1;
|
||||||
|
|
||||||
// if (bat_volt < batt_min) {
|
// if (bat_volt < batt_min) {
|
||||||
// box_battery_percent=0;
|
// box_battery_percent=0;
|
||||||
@ -586,13 +599,30 @@ void app_show_memory_detect_info(){
|
|||||||
}
|
}
|
||||||
rtos_stop_timer(&timer_battery_refresh);
|
rtos_stop_timer(&timer_battery_refresh);
|
||||||
OLED_Clear();
|
OLED_Clear();
|
||||||
OLED_ShowString(2,1,(u8 *)"M1",16,1);
|
OLED_ShowString(21,5,(u8 *)"M1",32,1);
|
||||||
|
OLED_Refresh();
|
||||||
|
rt_thread_mdelay(1000);
|
||||||
|
|
||||||
|
OLED_Clear();
|
||||||
char str_temp[12]={0};
|
char str_temp[12]={0};
|
||||||
rt_sprintf(str_temp,"%d.%d C\n",record.temperature_value/100,record.temperature_value/10%10);
|
//rt_sprintf(str_temp,"%d.%d\n",record.temperature_value/100,record.temperature_value/10%10);
|
||||||
|
rt_memset(str_temp,0,sizeof(str_temp));
|
||||||
|
rt_sprintf(str_temp,"%d",record.temperature_value/100/10);//整数
|
||||||
|
OLED_ShowString(0,0,(u8*)str_temp,48,1);
|
||||||
|
rt_sprintf(str_temp,"%d",record.temperature_value/100%10);//整数
|
||||||
|
OLED_ShowString(19,0,(u8*)str_temp,48,1);
|
||||||
|
|
||||||
|
OLED_ShowChar(35,0+18,'.',24,1);//小数点
|
||||||
|
|
||||||
|
rt_memset(str_temp,0,sizeof(str_temp));
|
||||||
|
rt_sprintf(str_temp,"%d",record.temperature_value/10%10);//小数点后一位
|
||||||
|
OLED_ShowString(41,0,(u8*)str_temp,48,1);
|
||||||
|
OLED_ShowChar(61,18,'C',24,1);
|
||||||
|
OLED_DrawCircle(63,10,4);
|
||||||
//rt_sprintf(str_temp,"")
|
//rt_sprintf(str_temp,"")
|
||||||
//OLED_ShowString(0,18,(u8 *)"36.5 C",24,1);
|
//OLED_ShowString(0,18,(u8 *)"36.5 C",24,1);
|
||||||
OLED_ShowString(0,18,(u8 *)str_temp,24,1);
|
//OLED_ShowString(0,0,(u8 *)str_temp,48,1);
|
||||||
OLED_DrawCircle(55,15,4);
|
//OLED_DrawCircle(55,15,4);
|
||||||
OLED_Refresh();
|
OLED_Refresh();
|
||||||
rt_thread_mdelay(1000);
|
rt_thread_mdelay(1000);
|
||||||
}
|
}
|
||||||
@ -664,21 +694,23 @@ static void app_temperature_ui_detect_entry(void *parameter)
|
|||||||
rt_sprintf(str_temp,"%d.%d \n",temp_body/100,temp_body/10%10);
|
rt_sprintf(str_temp,"%d.%d \n",temp_body/100,temp_body/10%10);
|
||||||
//rt_kprintf("%s\r\n",str_temp);
|
//rt_kprintf("%s\r\n",str_temp);
|
||||||
|
|
||||||
if(temp_body > BLE_TEMPERATURE_LIMIT_MIN && temp_body < BLE_TEMPERATURE_LIMIT_MAX){
|
//if(temp_body > BLE_TEMPERATURE_LIMIT_MIN && temp_body < BLE_TEMPERATURE_LIMIT_MAX){
|
||||||
OLED_Clear();
|
OLED_Clear();
|
||||||
rt_memset(str_temp,0,sizeof(str_temp));
|
rt_memset(str_temp,0,sizeof(str_temp));
|
||||||
rt_sprintf(str_temp,"%d",temp_body/100);//整数
|
rt_sprintf(str_temp,"%d",temp_body/100/10);//整数
|
||||||
OLED_ShowString(0,0+10,(u8*)str_temp,32,1);
|
OLED_ShowString(0,0,(u8*)str_temp,48,1);
|
||||||
|
rt_sprintf(str_temp,"%d",temp_body/100%10);//整数
|
||||||
|
OLED_ShowString(19,0,(u8*)str_temp,48,1);
|
||||||
|
|
||||||
OLED_ShowChar(32,0+10,'.',32,1);//小数点
|
OLED_ShowChar(35,0+18,'.',24,1);//小数点
|
||||||
|
|
||||||
rt_memset(str_temp,0,sizeof(str_temp));
|
rt_memset(str_temp,0,sizeof(str_temp));
|
||||||
rt_sprintf(str_temp,"%d",temp_body/10%10);//小数点后一位
|
rt_sprintf(str_temp,"%d",temp_body/10%10);//小数点后一位
|
||||||
OLED_ShowString(40,0+10,(u8*)str_temp,32,1);
|
OLED_ShowString(41,0,(u8*)str_temp,48,1);
|
||||||
OLED_ShowChar(61,16,'C',24,1);
|
OLED_ShowChar(61,18,'C',24,1);
|
||||||
//屏幕上的点(度) 闪烁
|
//屏幕上的点(度) 闪烁
|
||||||
if(ui_show_point){
|
if(ui_show_point){
|
||||||
OLED_DrawCircle(62,10,4);
|
OLED_DrawCircle(63,10,4);
|
||||||
//未测量完成才允许闪烁
|
//未测量完成才允许闪烁
|
||||||
if(temperature_info.device_state == STATE_DETECT_ING){
|
if(temperature_info.device_state == STATE_DETECT_ING){
|
||||||
ui_show_point = 0;
|
ui_show_point = 0;
|
||||||
@ -687,9 +719,9 @@ static void app_temperature_ui_detect_entry(void *parameter)
|
|||||||
ui_show_point = 1;
|
ui_show_point = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
if(temp_body < BLE_TEMPERATURE_LIMIT_MIN){
|
/*if(temp_body < BLE_TEMPERATURE_LIMIT_MIN){
|
||||||
OLED_Clear();
|
OLED_Clear();
|
||||||
//OLED_ShowString(0+10,0+5,(u8 *)"LOW",32,1);
|
//OLED_ShowString(0+10,0+5,(u8 *)"LOW",32,1);
|
||||||
OLED_ShowChinese(3,5,0,32,1); //低
|
OLED_ShowChinese(3,5,0,32,1); //低
|
||||||
@ -701,7 +733,7 @@ static void app_temperature_ui_detect_entry(void *parameter)
|
|||||||
//OLED_ShowString(0+5,0+5,(u8 *)"HIGH",32,1);
|
//OLED_ShowString(0+5,0+5,(u8 *)"HIGH",32,1);
|
||||||
OLED_ShowChinese(3,5,9,32,1); //超
|
OLED_ShowChinese(3,5,9,32,1); //超
|
||||||
OLED_ShowChinese(35,5,2,32,1);//温
|
OLED_ShowChinese(35,5,2,32,1);//温
|
||||||
}
|
}*/
|
||||||
|
|
||||||
OLED_Refresh();
|
OLED_Refresh();
|
||||||
}
|
}
|
||||||
@ -816,9 +848,12 @@ void app_enter_ui(app_ui_mode mode){
|
|||||||
{
|
{
|
||||||
case UI_BOX_BATTERY:
|
case UI_BOX_BATTERY:
|
||||||
app_show_box_battery();
|
app_show_box_battery();
|
||||||
|
//static int battery_timer_inited = 0;
|
||||||
rtos_init_timer(&timer_battery_refresh, 10000, timer_battery_refresh_callback, NULL);
|
|
||||||
rtos_start_timer(&timer_battery_refresh);
|
rtos_init_timer(&timer_battery_refresh, 10000, timer_battery_refresh_callback, NULL);
|
||||||
|
rtos_start_timer(&timer_battery_refresh);
|
||||||
|
// battery_timer_inited = 1;
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case UI_SHOW_DEVICE_INFO:
|
case UI_SHOW_DEVICE_INFO:
|
||||||
@ -848,6 +883,39 @@ void app_enter_ui(app_ui_mode mode){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void volume_save_record(app_detect_record_t *record){
|
||||||
|
EfErrCode result = EF_NO_ERR;
|
||||||
|
//char t[sizeof(app_detect_record_t)] = {0x88,0x86,0x89};
|
||||||
|
//app_detect_record_t record;
|
||||||
|
//record.temperature_value = t_value;
|
||||||
|
char data[32];
|
||||||
|
rt_memset(data,0,sizeof(data));
|
||||||
|
rt_sprintf(data,"%d",record->volume);
|
||||||
|
|
||||||
|
result = ef_set_env(BLE_TEMPERATURE_FLASH_RECORD_KEY_VOLUME, data);
|
||||||
|
result = ef_save_env();
|
||||||
|
if (result == EF_NO_ERR)
|
||||||
|
{
|
||||||
|
rt_kprintf("volume_save_record success !!!\r\n");
|
||||||
|
}else{
|
||||||
|
rt_kprintf("volume_save_record failed !!!\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void volume_read_record(app_detect_record_t *record){
|
||||||
|
rt_memset(record,0,sizeof(app_detect_record_t));
|
||||||
|
/*获取easy flash存入的数据*/
|
||||||
|
char *t = ef_get_env(BLE_TEMPERATURE_FLASH_RECORD_KEY_VOLUME);
|
||||||
|
if(t != NULL){
|
||||||
|
//rt_kprintf("%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\r\n",t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9]);
|
||||||
|
//rt_memcpy(record,t,sizeof(app_detect_record_t));
|
||||||
|
uint8 Volume = atoi(t);
|
||||||
|
record->volume = Volume;
|
||||||
|
}else{
|
||||||
|
rt_kprintf("volume_read_record error\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存最新的一次记录
|
* 保存最新的一次记录
|
||||||
*/
|
*/
|
||||||
@ -907,15 +975,15 @@ void charge_sleep_on(int on) {
|
|||||||
// voice_player_mute(1); //声音
|
// voice_player_mute(1); //声音
|
||||||
// rtos_start_timer(&timer_detect);
|
// rtos_start_timer(&timer_detect);
|
||||||
// bk_wlan_start_sta(BK_STATION); //WIFI
|
// bk_wlan_start_sta(BK_STATION); //WIFI
|
||||||
// belon_ble_scan_start(); //蓝牙扫描
|
belon_ble_scan_start(); //蓝牙扫描
|
||||||
// belon_ble_start_adv(); //蓝牙广播
|
belon_ble_start_adv(); //蓝牙广播
|
||||||
}else{
|
}else{
|
||||||
OLED_DisPlay_Off();//屏幕
|
OLED_DisPlay_Off();//屏幕
|
||||||
voice_player_mute(0); //声音
|
voice_player_mute(0); //声音
|
||||||
// rtos_stop_timer(&timer_detect);
|
// rtos_stop_timer(&timer_detect);
|
||||||
// //bk_wlan_stop(BK_STATION); //WIFI
|
// //bk_wlan_stop(BK_STATION); //WIFI
|
||||||
// belon_ble_scan_stop(); //蓝牙扫描
|
belon_ble_scan_stop(); //蓝牙扫描
|
||||||
// belon_ble_deinit_adv(); //蓝牙广播
|
belon_ble_deinit_adv(); //蓝牙广播
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1048,8 +1116,8 @@ void timer_hall_detect_callback(void *arg){
|
|||||||
rtos_stop_timer(&timer_poweroff);
|
rtos_stop_timer(&timer_poweroff);
|
||||||
}
|
}
|
||||||
if(!oled_is_on){ //充电时开盖复位设备
|
if(!oled_is_on){ //充电时开盖复位设备
|
||||||
rt_kprintf("charge_sleep_on(1) !!!\r\n");
|
|
||||||
charge_sleep_on(1);
|
charge_sleep_on(1);
|
||||||
|
rt_kprintf("charge_sleep_on(1) !!!\r\n");
|
||||||
}
|
}
|
||||||
// 只有在5秒内且开关盖次数达到5才进入绑定
|
// 只有在5秒内且开关盖次数达到5才进入绑定
|
||||||
if(start_bind_detect && hall_key_down_count == 5 && (now_tick - hall_first_down_tick <= HALL_BIND_WINDOW_MS)){
|
if(start_bind_detect && hall_key_down_count == 5 && (now_tick - hall_first_down_tick <= HALL_BIND_WINDOW_MS)){
|
||||||
@ -1332,11 +1400,25 @@ void poka_client_password(){
|
|||||||
rt_kprintf("password=%s\r\n", mqtt_password);
|
rt_kprintf("password=%s\r\n", mqtt_password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void record_init(void){
|
||||||
|
app_detect_record_t record;
|
||||||
|
memset((void *)&record, 0, sizeof(record));
|
||||||
|
volume_read_record(&record);
|
||||||
|
rt_kprintf("record.volume=%d record.temperature_value=%d record.timestamp=%d\r\n", record.volume,record.temperature_value,record.timestamp);
|
||||||
|
if(record.volume==0&&record.temperature_value==0){
|
||||||
|
record.volume=70;
|
||||||
|
volume_save_record(&record);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void temperature_init(void){
|
void temperature_init(void){
|
||||||
|
|
||||||
extern long list_memheap(void);
|
extern long list_memheap(void);
|
||||||
|
//rt_thread_mdelay(3000);
|
||||||
list_memheap();
|
list_memheap();
|
||||||
bk_wlan_stop(BK_STATION);
|
//bk_wlan_stop(1);
|
||||||
|
//bk_wlan_stop(0);
|
||||||
temperature_led_ble(0);
|
temperature_led_ble(0);
|
||||||
// 查询绑定设备
|
// 查询绑定设备
|
||||||
//uint8_t test_device_mac[6] = {0xe5, 0xe6, 0xb6, 0x09, 0x28, 0x37};
|
//uint8_t test_device_mac[6] = {0xe5, 0xe6, 0xb6, 0x09, 0x28, 0x37};
|
||||||
@ -1358,12 +1440,9 @@ void temperature_init(void){
|
|||||||
rtos_init_timer(&timer_poweroff, BLE_TEMPERATURE_POWEROFF_TIMEOUT, box_poweroff_timeout_callback, NULL);
|
rtos_init_timer(&timer_poweroff, BLE_TEMPERATURE_POWEROFF_TIMEOUT, box_poweroff_timeout_callback, NULL);
|
||||||
rtos_init_timer(&timer_bind, BLE_TEMPERATURE_BIND_MODE_TIMEOUT, box_bind_timeout_callback, NULL);
|
rtos_init_timer(&timer_bind, BLE_TEMPERATURE_BIND_MODE_TIMEOUT, box_bind_timeout_callback, NULL);
|
||||||
rtos_init_timer(&timer_idle, BLE_TEMPERATURE_IDLE_MODE_TIMEOUT, timer_app_idle_callback, NULL);
|
rtos_init_timer(&timer_idle, BLE_TEMPERATURE_IDLE_MODE_TIMEOUT, timer_app_idle_callback, NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//初始化电量
|
//初始化电量
|
||||||
box_init_power();
|
box_init_power();
|
||||||
// user_app_start();
|
//user_app_start();
|
||||||
|
|
||||||
app_enter_ui(UI_BOX_BATTERY);
|
app_enter_ui(UI_BOX_BATTERY);
|
||||||
|
|
||||||
@ -1377,12 +1456,13 @@ void temperature_init(void){
|
|||||||
//app_show_last_detect_info();
|
//app_show_last_detect_info();
|
||||||
|
|
||||||
app_enter_ui(UI_SHOW_MEMORY_INFO);
|
app_enter_ui(UI_SHOW_MEMORY_INFO);
|
||||||
|
app_show_wait_temperature();
|
||||||
//app_enter_ui(UI_WAIT_TEMPERATURE);
|
//app_enter_ui(UI_WAIT_TEMPERATURE);
|
||||||
|
|
||||||
//注册WIFI回调
|
//注册WIFI回调
|
||||||
bk_wlan_status_register_cb(wifi_status_cb);
|
//bk_wlan_status_register_cb(wifi_status_cb);
|
||||||
//自动联网
|
//自动联网
|
||||||
//wifi_init();
|
wifi_init();
|
||||||
|
|
||||||
//初始化BLE
|
//初始化BLE
|
||||||
belon_ble_active();
|
belon_ble_active();
|
||||||
@ -1396,16 +1476,19 @@ void temperature_init(void){
|
|||||||
rtos_init_timer(&timer_detect, BLE_TEMPERATURE_DETECT_DEVICE_INTERVAL, timer_check_device_run_callback, NULL);
|
rtos_init_timer(&timer_detect, BLE_TEMPERATURE_DETECT_DEVICE_INTERVAL, timer_check_device_run_callback, NULL);
|
||||||
rtos_start_timer(&timer_detect);
|
rtos_start_timer(&timer_detect);
|
||||||
|
|
||||||
// rtos_init_timer(&timer_charge_hell, 300000, timer_charge_hell, NULL);
|
rtos_init_timer(&timer_charge_hell, 300000, timer_hall_detect_callback, NULL);
|
||||||
// rtos_start_timer(&timer_charge_hell);
|
rtos_start_timer(&timer_charge_hell);
|
||||||
|
|
||||||
charger_module_enable(0);
|
charger_module_enable(0);
|
||||||
//sctrl_ctrl(CMD_SCTRL_USB_CHARGE_STOP, 0);
|
//sctrl_ctrl(CMD_SCTRL_USB_CHARGE_STOP, 0);
|
||||||
voice_player_mute(1);
|
voice_player_mute(1);
|
||||||
voice_player_init();
|
voice_player_init();
|
||||||
|
record_init();
|
||||||
|
|
||||||
list_memheap();
|
list_memheap();
|
||||||
|
|
||||||
|
//belon_ble_scan_stop();
|
||||||
|
//belon_ble_deinit_adv();
|
||||||
|
|
||||||
//app_tcp_init();
|
//app_tcp_init();
|
||||||
//app_tcp_connect();
|
//app_tcp_connect();
|
||||||
|
@ -42,6 +42,11 @@
|
|||||||
*/
|
*/
|
||||||
#define BLE_TEMPERATURE_DETECT_DEVICE_INTERVAL 1000
|
#define BLE_TEMPERATURE_DETECT_DEVICE_INTERVAL 1000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 蓝牙扫描间隔时间
|
||||||
|
*/
|
||||||
|
#define BLE_SCAN_INTERVAL 8000
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示温度最小值 低于该值显示LOW
|
* 显示温度最小值 低于该值显示LOW
|
||||||
*/
|
*/
|
||||||
@ -87,7 +92,7 @@
|
|||||||
/**
|
/**
|
||||||
* 超时25s 都没有收到温度广播数据 回到等待测温页面
|
* 超时25s 都没有收到温度广播数据 回到等待测温页面
|
||||||
*/
|
*/
|
||||||
#define BLE_TEMPERATURE_IDLE_MODE_TIMEOUT 25000 //ms
|
#define BLE_TEMPERATURE_IDLE_MODE_TIMEOUT 30000 //ms
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置文件easyflah KEY
|
* 配置文件easyflah KEY
|
||||||
@ -117,6 +122,11 @@
|
|||||||
* 测温记录 easyflah KEY time
|
* 测温记录 easyflah KEY time
|
||||||
*/
|
*/
|
||||||
#define BLE_TEMPERATURE_FLASH_RECORD_KEY_TIMESTAMP "m1_timestamp"
|
#define BLE_TEMPERATURE_FLASH_RECORD_KEY_TIMESTAMP "m1_timestamp"
|
||||||
|
/**
|
||||||
|
* 音量记录 easyflah KEY volume
|
||||||
|
*/
|
||||||
|
#define BLE_TEMPERATURE_FLASH_RECORD_KEY_VOLUME "m1_volume"
|
||||||
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
@ -173,8 +183,9 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8_t timestamp[8];
|
uint8_t timestamp[8];
|
||||||
uint16_t temperature_value;
|
uint16_t temperature_value;
|
||||||
|
uint8_t volume;
|
||||||
}app_detect_record_t;
|
}app_detect_record_t;
|
||||||
|
|
||||||
|
|
||||||
@ -199,6 +210,7 @@ int mqtt_start(char username[],char password[]);
|
|||||||
void poka_client_password();
|
void poka_client_password();
|
||||||
void poka_client_username();
|
void poka_client_username();
|
||||||
void connnect_wifi(char *oob_ssid,char *connect_key);
|
void connnect_wifi(char *oob_ssid,char *connect_key);
|
||||||
|
void timer_ble_scan_callback(void *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存最新的一次记录
|
* 保存最新的一次记录
|
||||||
@ -213,4 +225,8 @@ void temperature_read_record(app_detect_record_t *record);
|
|||||||
void temperature_led_ble(bool onoff);
|
void temperature_led_ble(bool onoff);
|
||||||
|
|
||||||
void app_enter_ui(app_ui_mode mode);
|
void app_enter_ui(app_ui_mode mode);
|
||||||
|
|
||||||
|
void volume_read_record(app_detect_record_t *record);
|
||||||
|
|
||||||
|
void volume_save_record(app_detect_record_t *record);
|
||||||
#endif //_APP_TEMPERATURE_H_
|
#endif //_APP_TEMPERATURE_H_
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "app_voice_player.h"
|
#include "app_voice_player.h"
|
||||||
|
|
||||||
#include "tts_player.h"
|
#include "tts_player.h"
|
||||||
|
#include "player.h"
|
||||||
|
|
||||||
static char *tts_list[6] = {NULL};
|
static char *tts_list[6] = {NULL};
|
||||||
char * voice_get_mp3_file(int num){
|
char * voice_get_mp3_file(int num){
|
||||||
@ -59,12 +60,20 @@ char * voice_get_mp3_file(int num){
|
|||||||
/* 播放一个文件*/
|
/* 播放一个文件*/
|
||||||
void voice_tts_player_play_one(void *p)
|
void voice_tts_player_play_one(void *p)
|
||||||
{
|
{
|
||||||
|
app_detect_record_t record;
|
||||||
|
memset((void *)&record, 0, sizeof(record));
|
||||||
|
volume_read_record(&record);
|
||||||
|
player_set_volume(record.volume);
|
||||||
tts_player_block(tts_list, 1);
|
tts_player_block(tts_list, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 阻塞式播放 TTS */
|
/* 阻塞式播放 TTS */
|
||||||
void voice_tts_player_block_run(void *p)
|
void voice_tts_player_block_run(void *p)
|
||||||
{
|
{
|
||||||
|
app_detect_record_t record;
|
||||||
|
memset((void *)&record, 0, sizeof(record));
|
||||||
|
volume_read_record(&record);
|
||||||
|
player_set_volume(record.volume);
|
||||||
tts_player_block(tts_list, sizeof(tts_list)/sizeof(char *));
|
tts_player_block(tts_list, sizeof(tts_list)/sizeof(char *));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +133,9 @@ void voice_player_init()
|
|||||||
{
|
{
|
||||||
audio_device_init();
|
audio_device_init();
|
||||||
audio_device_set_rate(16000);
|
audio_device_set_rate(16000);
|
||||||
audio_device_set_volume(30);
|
|
||||||
audio_device_open();
|
audio_device_open();
|
||||||
|
//player_set_volume(1);
|
||||||
|
rt_kprintf("volume=%d\r\n", player_set_volume(1));
|
||||||
|
|
||||||
//audio_device_mic_open();
|
//audio_device_mic_open();
|
||||||
//voice_play(1);
|
//voice_play(1);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "kernel_mem.h"
|
#include "kernel_mem.h"
|
||||||
#include "easyflash.h"
|
#include "easyflash.h"
|
||||||
|
|
||||||
|
|
||||||
#define BUILD_UINT16(loByte, hiByte) \
|
#define BUILD_UINT16(loByte, hiByte) \
|
||||||
((uint16_t)(((loByte) & 0x00FF) + (((hiByte) & 0x00FF) << 8)))
|
((uint16_t)(((loByte) & 0x00FF) + (((hiByte) & 0x00FF) << 8)))
|
||||||
|
|
||||||
@ -38,6 +39,8 @@
|
|||||||
#define BLE_WIFI_FLASH_KEY_CHANNEL "wifi_channel"
|
#define BLE_WIFI_FLASH_KEY_CHANNEL "wifi_channel"
|
||||||
#define BLE_WIFI_FLASH_KEY_SECURITY "wifi_security"
|
#define BLE_WIFI_FLASH_KEY_SECURITY "wifi_security"
|
||||||
#define BLE_IDLE_TIMEOUT_MS 10000 // 10秒无操作超时
|
#define BLE_IDLE_TIMEOUT_MS 10000 // 10秒无操作超时
|
||||||
|
#define HTTP_OTA_URL "http://192.168.7.105:8080/all_2M.1220.bin"
|
||||||
|
|
||||||
|
|
||||||
//WIFI账号密码
|
//WIFI账号密码
|
||||||
char last_ssid[33] = {0};
|
char last_ssid[33] = {0};
|
||||||
@ -132,7 +135,7 @@ uint8_t cli_ble_read_callback(read_req_t *read_req)
|
|||||||
read_req->value[2] = 0x30;
|
read_req->value[2] = 0x30;
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
static void ble_command_usage(void)
|
static void ble_command_usage(void)
|
||||||
{
|
{
|
||||||
bk_printf("ble help - Help information\n");
|
bk_printf("ble help - Help information\n");
|
||||||
@ -146,12 +149,12 @@ static void ble_command_usage(void)
|
|||||||
|
|
||||||
bk_printf("ble disc - Disconnect\n");
|
bk_printf("ble disc - Disconnect\n");
|
||||||
bk_printf("ble dut - dut test\n");
|
bk_printf("ble dut - dut test\n");
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
void sdp_event_cb(sdp_notice_t notice, void *param)
|
void sdp_event_cb(sdp_notice_t notice, void *param)
|
||||||
{
|
{
|
||||||
switch (notice) {
|
/*switch (notice) {
|
||||||
case SDP_CHARAC_NOTIFY_EVENT:
|
case SDP_CHARAC_NOTIFY_EVENT:
|
||||||
{
|
{
|
||||||
sdp_event_t *g_sdp = (sdp_event_t *)param;
|
sdp_event_t *g_sdp = (sdp_event_t *)param;
|
||||||
@ -183,7 +186,7 @@ void sdp_event_cb(sdp_notice_t notice, void *param)
|
|||||||
default:
|
default:
|
||||||
bk_printf("[%s]Event:%d\r\n",__func__,notice);
|
bk_printf("[%s]Event:%d\r\n",__func__,notice);
|
||||||
break;
|
break;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void ble_cmd_cb(ble_cmd_t cmd, ble_cmd_param_t *param)
|
void ble_cmd_cb(ble_cmd_t cmd, ble_cmd_param_t *param)
|
||||||
@ -376,7 +379,7 @@ void ble_connnect_wifi(uint8_t data[]){
|
|||||||
static void ble_idle_timeout_cb(void *parameter){
|
static void ble_idle_timeout_cb(void *parameter){
|
||||||
ble_report_state(0); // 无操作
|
ble_report_state(0); // 无操作
|
||||||
}
|
}
|
||||||
|
extern void http_ota(uint8_t argc, char **argv);
|
||||||
void ble_notice_cb(ble_notice_t notice, void *param)
|
void ble_notice_cb(ble_notice_t notice, void *param)
|
||||||
{
|
{
|
||||||
switch (notice) {
|
switch (notice) {
|
||||||
@ -399,7 +402,6 @@ void ble_notice_cb(ble_notice_t notice, void *param)
|
|||||||
bk_printf("mac:%s\r\n",w_req->value);
|
bk_printf("mac:%s\r\n",w_req->value);
|
||||||
//flash_write((uint8_t *)&dev_config, sizeof(dev_config), (UINT32)0x1FD000);
|
//flash_write((uint8_t *)&dev_config, sizeof(dev_config), (UINT32)0x1FD000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strstr((char *)data,"AT+SCAN")!=NULL){ //扫描wifi命令:AT+SCAN
|
if(strstr((char *)data,"AT+SCAN")!=NULL){ //扫描wifi命令:AT+SCAN
|
||||||
bk_printf("start WiFi scan...\r\n");
|
bk_printf("start WiFi scan...\r\n");
|
||||||
rtos_reload_timer(&ble_idle);
|
rtos_reload_timer(&ble_idle);
|
||||||
@ -407,18 +409,70 @@ void ble_notice_cb(ble_notice_t notice, void *param)
|
|||||||
mhdr_scanu_reg_cb(scan_cb, 0);
|
mhdr_scanu_reg_cb(scan_cb, 0);
|
||||||
bk_wlan_start_scan();
|
bk_wlan_start_scan();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strncmp((char *)data, "AT+WIFI:", 8) == 0){ //连接WiFi命令:AT+WIFI:SSID,PASSWORD
|
if(strncmp((char *)data, "AT+WIFI:", 8) == 0){ //连接WiFi命令:AT+WIFI:SSID,PASSWORD
|
||||||
ble_connnect_wifi(data);
|
ble_connnect_wifi(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strstr((char *)data,"AT+STATE")!=NULL){ //返回当前状态
|
if(strstr((char *)data,"AT+STATE")!=NULL){ //返回当前状态
|
||||||
char msg[32] = "AT+STATE=0";
|
char msg[32] = "AT+STATE=0";
|
||||||
bk_ble_send_ntf_value(strlen(msg), (uint8_t*)msg, 0, TEST_IDX_FF03_VAL_VALUE);
|
bk_ble_send_ntf_value(strlen(msg), (uint8_t*)msg, 0, TEST_IDX_FF03_VAL_VALUE);
|
||||||
}
|
}
|
||||||
if(strstr((char *)data,"AT+VER=")!=NULL){ //返回当前状态
|
if(strstr((char *)data,"AT+VER=")!=NULL){ //返回当前版本
|
||||||
char msg[32] = "AT+VER=1.0.0";
|
char msg[32] = "AT+VER=1.0.0";
|
||||||
bk_ble_send_ntf_value(strlen(msg), (uint8_t*)msg, 0, TEST_IDX_FF03_VAL_VALUE);
|
bk_ble_send_ntf_value(strlen(msg), (uint8_t*)msg, 0, TEST_IDX_FF03_VAL_VALUE);
|
||||||
|
}
|
||||||
|
if(strstr((char *)data,"AT+UPDATE")!=NULL){ //wifi升级
|
||||||
|
char *url_ptr = HTTP_OTA_URL;
|
||||||
|
http_ota(1, &url_ptr);
|
||||||
|
}
|
||||||
|
if(strstr((char *)data,"AT+VOICE++")!=NULL){ //声音+
|
||||||
|
app_detect_record_t record;
|
||||||
|
|
||||||
|
memset((void *)&record, 0, sizeof(record));
|
||||||
|
volume_read_record(&record);
|
||||||
|
record.volume+=10;
|
||||||
|
if(record.volume>=99)
|
||||||
|
record.volume=99;
|
||||||
|
if(record.volume<=0)
|
||||||
|
record.volume=0;
|
||||||
|
volume_save_record(&record);
|
||||||
|
|
||||||
|
char msg[32];
|
||||||
|
int len = snprintf(msg, sizeof(msg), "AT+VOLUME=%d", record.volume);
|
||||||
|
bk_ble_send_ntf_value(len, (uint8_t*)msg, 0, TEST_IDX_FF03_VAL_VALUE);
|
||||||
|
}
|
||||||
|
if(strstr((char *)data,"AT+VOICE--")!=NULL){ //声音-
|
||||||
|
app_detect_record_t record;
|
||||||
|
|
||||||
|
memset((void *)&record, 0, sizeof(record));
|
||||||
|
volume_read_record(&record);
|
||||||
|
record.volume-=10;
|
||||||
|
if(record.volume>=99)
|
||||||
|
record.volume=99;
|
||||||
|
if(record.volume<=0)
|
||||||
|
record.volume=0;
|
||||||
|
volume_save_record(&record);
|
||||||
|
|
||||||
|
char msg[32];
|
||||||
|
int len = snprintf(msg, sizeof(msg), "AT+VOLUME=%d", record.volume);
|
||||||
|
bk_ble_send_ntf_value(len, (uint8_t*)msg, 0, TEST_IDX_FF03_VAL_VALUE);
|
||||||
|
}
|
||||||
|
if(strstr((char *)data,"AT+SETVOICE=")!=NULL){ //声音-
|
||||||
|
app_detect_record_t record;
|
||||||
|
|
||||||
|
int new_volume;
|
||||||
|
memset((void *)&record, 0, sizeof(record));
|
||||||
|
volume_read_record(&record);
|
||||||
|
if(sscanf((char*)data, "AT+VOLUME=%d", &new_volume) == 1) {
|
||||||
|
record.volume = new_volume;
|
||||||
|
if(record.volume>=99)
|
||||||
|
record.volume=99;
|
||||||
|
if(record.volume<=0)
|
||||||
|
record.volume=0;
|
||||||
|
}
|
||||||
|
volume_save_record(&record);
|
||||||
|
char msg[32];
|
||||||
|
int len = snprintf(msg, sizeof(msg), "AT+VOLUME=%d", record.volume);
|
||||||
|
bk_ble_send_ntf_value(len, (uint8_t*)msg, 0, TEST_IDX_FF03_VAL_VALUE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -556,7 +610,8 @@ void ble_notice_cb(ble_notice_t notice, void *param)
|
|||||||
discon_ind_t *d_ind = (discon_ind_t *)param;
|
discon_ind_t *d_ind = (discon_ind_t *)param;
|
||||||
bk_printf("d_ind:conn_idx:%d,reason:%d\r\n", d_ind->conn_idx,d_ind->reason);
|
bk_printf("d_ind:conn_idx:%d,reason:%d\r\n", d_ind->conn_idx,d_ind->reason);
|
||||||
//断开连接之后 重新打开广播
|
//断开连接之后 重新打开广播
|
||||||
|
belon_ble_start_adv();
|
||||||
|
//belon_ble_active();
|
||||||
//belon_ble_init_adv();
|
//belon_ble_init_adv();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -631,7 +686,7 @@ void ble_notice_cb(ble_notice_t notice, void *param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void ble(int argc, char **argv)
|
static void ble(int argc, char **argv)
|
||||||
{
|
{/*
|
||||||
uint8_t adv_data[31];
|
uint8_t adv_data[31];
|
||||||
uint8_t actv_idx;
|
uint8_t actv_idx;
|
||||||
if ((argc < 2) || (os_strcmp(argv[1], "help") == 0))
|
if ((argc < 2) || (os_strcmp(argv[1], "help") == 0))
|
||||||
@ -884,11 +939,11 @@ static void ble(int argc, char **argv)
|
|||||||
}else{
|
}else{
|
||||||
bk_printf("handle(%x) error\r\n",handle);
|
bk_printf("handle(%x) error\r\n",handle);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ble_advertise_start(int argc, char **argv)
|
static void ble_advertise_start(int argc, char **argv)
|
||||||
{
|
{/*
|
||||||
uint8_t adv_data[31];
|
uint8_t adv_data[31];
|
||||||
uint8_t actv_idx;
|
uint8_t actv_idx;
|
||||||
uint8_t adv_data_len;
|
uint8_t adv_data_len;
|
||||||
@ -927,7 +982,7 @@ static void ble_advertise_start(int argc, char **argv)
|
|||||||
bk_ble_set_scan_rsp_data(actv_idx, adv_data, adv_data_len, ble_cmd_cb);
|
bk_ble_set_scan_rsp_data(actv_idx, adv_data, adv_data_len, ble_cmd_cb);
|
||||||
|
|
||||||
rt_thread_mdelay(10);
|
rt_thread_mdelay(10);
|
||||||
bk_ble_start_advertising(actv_idx, 0, ble_cmd_cb);
|
bk_ble_start_advertising(actv_idx, 0, ble_cmd_cb);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void belon_ble_deinit_adv() {
|
void belon_ble_deinit_adv() {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -167,7 +167,7 @@ static int wlan_app_init(void)
|
|||||||
rt_kprintf("Enter normal mode...\r\n\r\n");
|
rt_kprintf("Enter normal mode...\r\n\r\n");
|
||||||
app_start();
|
app_start();
|
||||||
//iic_bus_attach();
|
//iic_bus_attach();
|
||||||
temperature_init();
|
temperature_init();
|
||||||
|
|
||||||
//opous_encoder_start();
|
//opous_encoder_start();
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
*/
|
*/
|
||||||
#define CFG_WIFI_AP_HW_MODE 0
|
#define CFG_WIFI_AP_HW_MODE 0
|
||||||
|
|
||||||
#define CfG_MACRO_MAYBE_UNUSED 1
|
#define CfG_MACRO_MAYBE_UNUSED 0
|
||||||
#if CfG_MACRO_MAYBE_UNUSED
|
#if CfG_MACRO_MAYBE_UNUSED
|
||||||
#define CFG_WIFI_RSSI 1
|
#define CFG_WIFI_RSSI 1
|
||||||
#define CFG_WIFI_VERSION 1
|
#define CFG_WIFI_VERSION 1
|
||||||
@ -160,7 +160,7 @@
|
|||||||
/* The following four macro will be reconstruct
|
/* The following four macro will be reconstruct
|
||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
#define CFG_ENABLE_SDIO_DEV 1
|
#define CFG_ENABLE_SDIO_DEV 0
|
||||||
#define CFG_SDIO 0
|
#define CFG_SDIO 0
|
||||||
#define CFG_SDIO_TRANS 0
|
#define CFG_SDIO_TRANS 0
|
||||||
#define CFG_REAL_SDIO 0
|
#define CFG_REAL_SDIO 0
|
||||||
@ -182,7 +182,7 @@
|
|||||||
#define CFG_SUPPORT_UVC 0
|
#define CFG_SUPPORT_UVC 0
|
||||||
#endif
|
#endif
|
||||||
#define CFG_USE_USB_CHARGE 0
|
#define CFG_USE_USB_CHARGE 0
|
||||||
#define CFG_USE_QSPI 1
|
#define CFG_USE_QSPI 0
|
||||||
|
|
||||||
/*section 4-----DEBUG macro config-----*/
|
/*section 4-----DEBUG macro config-----*/
|
||||||
#define CFG_UART_DEBUG 0
|
#define CFG_UART_DEBUG 0
|
||||||
@ -233,8 +233,8 @@
|
|||||||
#define CFG_USE_LWIP_NETSTACK 1
|
#define CFG_USE_LWIP_NETSTACK 1
|
||||||
|
|
||||||
/*section 9-----for DHCP servicers and client*/
|
/*section 9-----for DHCP servicers and client*/
|
||||||
#define CFG_USE_DHCP 1
|
#define CFG_USE_DHCP 0//1
|
||||||
#define CFG_USE_DHCPD 1 // for servicers in ap mode
|
#define CFG_USE_DHCPD 0//1 // for servicers in ap mode
|
||||||
|
|
||||||
/*section 11-----temperature detect*/
|
/*section 11-----temperature detect*/
|
||||||
#define CFG_USE_TEMPERATURE_DETECT 1
|
#define CFG_USE_TEMPERATURE_DETECT 1
|
||||||
@ -248,10 +248,10 @@
|
|||||||
|
|
||||||
#if CFG_WIFI_P2P
|
#if CFG_WIFI_P2P
|
||||||
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
|
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
|
||||||
#define CFG_USE_CAMERA_INTF 1
|
#define CFG_USE_CAMERA_INTF 0
|
||||||
#else
|
#else
|
||||||
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
|
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
|
||||||
#define CFG_USE_CAMERA_INTF 1
|
#define CFG_USE_CAMERA_INTF 0
|
||||||
#endif
|
#endif
|
||||||
#define CFG_USE_HSLAVE_SPI 0
|
#define CFG_USE_HSLAVE_SPI 0
|
||||||
#define CFG_USE_SPIDMA 0
|
#define CFG_USE_SPIDMA 0
|
||||||
@ -323,9 +323,9 @@
|
|||||||
|
|
||||||
/*section 21 ----- support ota*/
|
/*section 21 ----- support ota*/
|
||||||
#if( ( CFG_SUPPORT_ALIOS ) || ( CFG_SUPPORT_RTT ) || (CFG_SUPPORT_MATTER == 1))
|
#if( ( CFG_SUPPORT_ALIOS ) || ( CFG_SUPPORT_RTT ) || (CFG_SUPPORT_MATTER == 1))
|
||||||
#define CFG_SUPPORT_OTA_HTTP 1
|
#define CFG_SUPPORT_OTA_HTTP 0
|
||||||
#else
|
#else
|
||||||
#define CFG_SUPPORT_OTA_HTTP 1
|
#define CFG_SUPPORT_OTA_HTTP 0
|
||||||
#endif
|
#endif
|
||||||
#define CFG_SUPPORT_OTA_TFTP 0
|
#define CFG_SUPPORT_OTA_TFTP 0
|
||||||
|
|
||||||
@ -421,7 +421,7 @@
|
|||||||
#undef CFG_MBEDTLS
|
#undef CFG_MBEDTLS
|
||||||
#define CFG_MBEDTLS 1
|
#define CFG_MBEDTLS 1
|
||||||
#endif
|
#endif
|
||||||
#define CFG_USE_I2S 1
|
#define CFG_USE_I2S 0
|
||||||
|
|
||||||
/* watchdog, freertos only */
|
/* watchdog, freertos only */
|
||||||
#define CFG_INT_WDG_ENABLED 1
|
#define CFG_INT_WDG_ENABLED 1
|
||||||
@ -430,10 +430,10 @@
|
|||||||
#define CFG_TASK_WDG_PERIOD_MS 60000
|
#define CFG_TASK_WDG_PERIOD_MS 60000
|
||||||
|
|
||||||
/*section 29 ----- peripheral interface open */
|
/*section 29 ----- peripheral interface open */
|
||||||
#define CFG_USE_SPI 1
|
#define CFG_USE_SPI 0
|
||||||
#define CFG_USE_SPI_MASTER 1
|
#define CFG_USE_SPI_MASTER 0
|
||||||
#define CFG_USE_SPI_SLAVE 1
|
#define CFG_USE_SPI_SLAVE 0
|
||||||
#define CFG_USE_SPI_DMA 1
|
#define CFG_USE_SPI_DMA 0
|
||||||
|
|
||||||
/*section 30 ----- peripheral interface test case */
|
/*section 30 ----- peripheral interface test case */
|
||||||
#define CFG_PERIPHERAL_TEST 0
|
#define CFG_PERIPHERAL_TEST 0
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "arm_arch.h"
|
#include "arm_arch.h"
|
||||||
#include "str_pub.h"
|
#include "str_pub.h"
|
||||||
|
|
||||||
#if (CFG_SOC_NAME == SOC_BK7252N)
|
#if (CFG_SOC_NAME == SOC_BK7252N && CFG_USE_CAMERA_INF ==1)
|
||||||
#include "jpeg_encoder_pub.h"
|
#include "jpeg_encoder_pub.h"
|
||||||
#include "jpeg.h"
|
#include "jpeg.h"
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ const bk_logic_partition_t bk7231_partitions_2M[BK_PARTITION_MAX] =
|
|||||||
.partition_owner = BK_FLASH_EMBEDDED,
|
.partition_owner = BK_FLASH_EMBEDDED,
|
||||||
.partition_description = "Application",
|
.partition_description = "Application",
|
||||||
.partition_start_addr = 0x11000,
|
.partition_start_addr = 0x11000,
|
||||||
.partition_length = 0x121000,
|
.partition_length = 0x121000,//0xff000
|
||||||
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS,
|
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS,
|
||||||
},
|
},
|
||||||
[BK_PARTITION_OTA] =
|
[BK_PARTITION_OTA] =
|
||||||
|
@ -987,6 +987,8 @@ OSStatus bk_wlan_start_sta(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
size_t psk_len = 0;
|
size_t psk_len = 0;
|
||||||
u8 *psk = 0;
|
u8 *psk = 0;
|
||||||
|
|
||||||
|
bk_printf("2222222222222\r\n");
|
||||||
|
|
||||||
#if CFG_STA_AUTO_RECONNECT
|
#if CFG_STA_AUTO_RECONNECT
|
||||||
wlan_auto_reconnect_t ar;
|
wlan_auto_reconnect_t ar;
|
||||||
#endif
|
#endif
|
||||||
@ -1016,6 +1018,7 @@ OSStatus bk_wlan_start_sta(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
/* diconnect previous connection if may */
|
/* diconnect previous connection if may */
|
||||||
sta_ip_down(); // XXX: WLAN_DISCONNECT_EVENT may handle this
|
sta_ip_down(); // XXX: WLAN_DISCONNECT_EVENT may handle this
|
||||||
wlan_sta_disconnect();
|
wlan_sta_disconnect();
|
||||||
|
bk_printf("333333333333333333333\r\n");
|
||||||
#if CFG_STA_AUTO_RECONNECT
|
#if CFG_STA_AUTO_RECONNECT
|
||||||
wpa_ctrl_request(WPA_CTRL_CMD_WPAS_SET, (void *)false);
|
wpa_ctrl_request(WPA_CTRL_CMD_WPAS_SET, (void *)false);
|
||||||
#endif
|
#endif
|
||||||
@ -1026,6 +1029,7 @@ OSStatus bk_wlan_start_sta(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
bk_wlan_stop(BK_STATION);
|
bk_wlan_stop(BK_STATION);
|
||||||
#endif
|
#endif
|
||||||
mhdr_set_station_status(RW_EVT_STA_CONNECTING);
|
mhdr_set_station_status(RW_EVT_STA_CONNECTING);
|
||||||
|
bk_printf("4444444444444444444444444\r\n");
|
||||||
#if CFG_ROLE_LAUNCH
|
#if CFG_ROLE_LAUNCH
|
||||||
rl_status_reset_st_state(RL_ST_STATUS_RESTART_HOLD | RL_ST_STATUS_RESTART_ST);
|
rl_status_reset_st_state(RL_ST_STATUS_RESTART_HOLD | RL_ST_STATUS_RESTART_ST);
|
||||||
#endif
|
#endif
|
||||||
@ -1041,6 +1045,7 @@ OSStatus bk_wlan_start_sta(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
bk_wlan_sta_init(inNetworkInitPara);
|
bk_wlan_sta_init(inNetworkInitPara);
|
||||||
|
bk_printf("555555555555555555555555\r\n");
|
||||||
|
|
||||||
#if CFG_WPA_CTRL_IFACE && (CFG_WLAN_FAST_CONNECT || CFG_BSSID_FAST_CONNECT)
|
#if CFG_WPA_CTRL_IFACE && (CFG_WLAN_FAST_CONNECT || CFG_BSSID_FAST_CONNECT)
|
||||||
wlan_read_fast_connect_info(&fci);
|
wlan_read_fast_connect_info(&fci);
|
||||||
@ -1053,6 +1058,8 @@ OSStatus bk_wlan_start_sta(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
if(req_ssid_len > SSID_MAX_LEN)
|
if(req_ssid_len > SSID_MAX_LEN)
|
||||||
req_ssid_len = SSID_MAX_LEN;
|
req_ssid_len = SSID_MAX_LEN;
|
||||||
|
|
||||||
|
bk_printf("6666666666666666666666666\r\n");
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
print_hex_dump("fci: ", &fci, sizeof(fci));
|
print_hex_dump("fci: ", &fci, sizeof(fci));
|
||||||
bk_printf(" ssid: |%s|\n", fci.ssid);
|
bk_printf(" ssid: |%s|\n", fci.ssid);
|
||||||
@ -1066,6 +1073,7 @@ OSStatus bk_wlan_start_sta(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
(inNetworkInitPara->wifi_bssid &&
|
(inNetworkInitPara->wifi_bssid &&
|
||||||
os_memcmp(inNetworkInitPara->wifi_bssid, fci.bssid, 6) == 0 &&
|
os_memcmp(inNetworkInitPara->wifi_bssid, fci.bssid, 6) == 0 &&
|
||||||
os_strcmp(inNetworkInitPara->wifi_key, (char*)fci.pwd) == 0)) {
|
os_strcmp(inNetworkInitPara->wifi_key, (char*)fci.pwd) == 0)) {
|
||||||
|
|
||||||
|
|
||||||
chan = fci.channel;
|
chan = fci.channel;
|
||||||
psk = fci.psk;
|
psk = fci.psk;
|
||||||
@ -1085,6 +1093,7 @@ OSStatus bk_wlan_start_sta(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
bk_printf("777777777777777777777\r\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* let wpa_psk_cal thread to caculate psk.
|
* let wpa_psk_cal thread to caculate psk.
|
||||||
@ -1092,6 +1101,7 @@ OSStatus bk_wlan_start_sta(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
*/
|
*/
|
||||||
wpa_psk_request(g_sta_param_ptr->ssid.array, g_sta_param_ptr->ssid.length,
|
wpa_psk_request(g_sta_param_ptr->ssid.array, g_sta_param_ptr->ssid.length,
|
||||||
(char*)g_sta_param_ptr->key, psk, psk_len);
|
(char*)g_sta_param_ptr->key, psk, psk_len);
|
||||||
|
bk_printf("888888888888888888888\r\n");
|
||||||
|
|
||||||
#if CFG_STA_AUTO_RECONNECT
|
#if CFG_STA_AUTO_RECONNECT
|
||||||
/* set auto reconnect parameters */
|
/* set auto reconnect parameters */
|
||||||
@ -1381,6 +1391,7 @@ OSStatus bk_wlan_start(network_InitTypeDef_st *inNetworkInitPara)
|
|||||||
}
|
}
|
||||||
else if(inNetworkInitPara->wifi_mode == BK_STATION)
|
else if(inNetworkInitPara->wifi_mode == BK_STATION)
|
||||||
{
|
{
|
||||||
|
bk_printf("111111111111111\r\n");
|
||||||
#if CFG_ROLE_LAUNCH
|
#if CFG_ROLE_LAUNCH
|
||||||
lreq.req_type = LAUNCH_REQ_STA;
|
lreq.req_type = LAUNCH_REQ_STA;
|
||||||
lreq.descr = *inNetworkInitPara;
|
lreq.descr = *inNetworkInitPara;
|
||||||
|
@ -188,7 +188,7 @@
|
|||||||
#define PKG_USING_WEBCLIENT
|
#define PKG_USING_WEBCLIENT
|
||||||
#define WEBCLIENT_HEADER_BUFSZ 4096
|
#define WEBCLIENT_HEADER_BUFSZ 4096
|
||||||
#define WEBCLIENT_RESPONSE_BUFSZ 4096
|
#define WEBCLIENT_RESPONSE_BUFSZ 4096
|
||||||
#define PKG_USING_WEBCLIENT_LATEST_VERSION
|
//#define PKG_USING_WEBCLIENT_LATEST_VERSION
|
||||||
//#define PKG_USING_CJSON
|
//#define PKG_USING_CJSON
|
||||||
#define PKG_USING_CJSON_V102
|
#define PKG_USING_CJSON_V102
|
||||||
|
|
||||||
@ -279,7 +279,7 @@
|
|||||||
#define BEKEN_USING_UART2
|
#define BEKEN_USING_UART2
|
||||||
#define BEKEN_USING_WDT
|
#define BEKEN_USING_WDT
|
||||||
#define BEKEN_USING_FLASH
|
#define BEKEN_USING_FLASH
|
||||||
#define BEKEN_USING_PWM
|
//#define BEKEN_USING_PWM
|
||||||
#define BEKEN_USING_GPIO
|
#define BEKEN_USING_GPIO
|
||||||
#define BEKEN_USING_WLAN
|
#define BEKEN_USING_WLAN
|
||||||
#define LWIP_NETIF_HOSTNAME 1
|
#define LWIP_NETIF_HOSTNAME 1
|
||||||
@ -296,7 +296,7 @@
|
|||||||
#define PKG_USING_PLAYER
|
#define PKG_USING_PLAYER
|
||||||
#define PKG_USING_PLAYER_V127
|
#define PKG_USING_PLAYER_V127
|
||||||
#define PLAYER_DEVICE "sound"
|
#define PLAYER_DEVICE "sound"
|
||||||
#define PLAYER_DEFAULT_VOLUME 65
|
#define PLAYER_DEFAULT_VOLUME 0
|
||||||
|
|
||||||
/* PLAYER <20>ڲ<EFBFBD>֧<EFBFBD><D6A7> CODEC */
|
/* PLAYER <20>ڲ<EFBFBD>֧<EFBFBD><D6A7> CODEC */
|
||||||
//#define PLAYER_ENABLE_CODEC_PCM /* PCM<43><4D><EFBFBD><EFBFBD> */
|
//#define PLAYER_ENABLE_CODEC_PCM /* PCM<43><4D><EFBFBD><EFBFBD> */
|
||||||
@ -318,7 +318,7 @@
|
|||||||
#define PLAYER_USING_DEBUG 0 /* 0:<3A><><EFBFBD><EFBFBD><EFBFBD>汾, 1:<3A><><EFBFBD>汾 */
|
#define PLAYER_USING_DEBUG 0 /* 0:<3A><><EFBFBD><EFBFBD><EFBFBD>汾, 1:<3A><><EFBFBD>汾 */
|
||||||
|
|
||||||
/* PLAYER Example */
|
/* PLAYER Example */
|
||||||
//#define PLAYER_USING_EXAMPLE00
|
#define PLAYER_USING_EXAMPLE00
|
||||||
//#define PLAYER_USING_EXAMPLE02
|
//#define PLAYER_USING_EXAMPLE02
|
||||||
//#define PLAYER_USING_EXAMPLE03
|
//#define PLAYER_USING_EXAMPLE03
|
||||||
/* PLAYER END **************************************************************************** */
|
/* PLAYER END **************************************************************************** */
|
||||||
@ -327,12 +327,12 @@
|
|||||||
|
|
||||||
/* Test samples */
|
/* Test samples */
|
||||||
|
|
||||||
//#define PKG_USING_RT_OTA
|
#define PKG_USING_RT_OTA
|
||||||
|
|
||||||
#define RT_USING_PTHREADS
|
#define RT_USING_PTHREADS
|
||||||
|
|
||||||
/* voice changer */
|
/* voice changer */
|
||||||
#define CONFIG_VOICE_CHANGER 0
|
//#define CONFIG_VOICE_CHANGER 0
|
||||||
|
|
||||||
/* tools packages */
|
/* tools packages */
|
||||||
#define PKG_USING_EASYFLASH
|
#define PKG_USING_EASYFLASH
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
*/
|
*/
|
||||||
#define CFG_WIFI_AP_HW_MODE 0
|
#define CFG_WIFI_AP_HW_MODE 0
|
||||||
|
|
||||||
#define CfG_MACRO_MAYBE_UNUSED 1
|
#define CfG_MACRO_MAYBE_UNUSED 0
|
||||||
#if CfG_MACRO_MAYBE_UNUSED
|
#if CfG_MACRO_MAYBE_UNUSED
|
||||||
#define CFG_WIFI_RSSI 1
|
#define CFG_WIFI_RSSI 1
|
||||||
#define CFG_WIFI_VERSION 1
|
#define CFG_WIFI_VERSION 1
|
||||||
@ -160,7 +160,7 @@
|
|||||||
/* The following four macro will be reconstruct
|
/* The following four macro will be reconstruct
|
||||||
* TODO
|
* TODO
|
||||||
*/
|
*/
|
||||||
#define CFG_ENABLE_SDIO_DEV 1
|
#define CFG_ENABLE_SDIO_DEV 0
|
||||||
#define CFG_SDIO 0
|
#define CFG_SDIO 0
|
||||||
#define CFG_SDIO_TRANS 0
|
#define CFG_SDIO_TRANS 0
|
||||||
#define CFG_REAL_SDIO 0
|
#define CFG_REAL_SDIO 0
|
||||||
@ -182,7 +182,7 @@
|
|||||||
#define CFG_SUPPORT_UVC 0
|
#define CFG_SUPPORT_UVC 0
|
||||||
#endif
|
#endif
|
||||||
#define CFG_USE_USB_CHARGE 0
|
#define CFG_USE_USB_CHARGE 0
|
||||||
#define CFG_USE_QSPI 1
|
#define CFG_USE_QSPI 0
|
||||||
|
|
||||||
/*section 4-----DEBUG macro config-----*/
|
/*section 4-----DEBUG macro config-----*/
|
||||||
#define CFG_UART_DEBUG 0
|
#define CFG_UART_DEBUG 0
|
||||||
@ -233,8 +233,8 @@
|
|||||||
#define CFG_USE_LWIP_NETSTACK 1
|
#define CFG_USE_LWIP_NETSTACK 1
|
||||||
|
|
||||||
/*section 9-----for DHCP servicers and client*/
|
/*section 9-----for DHCP servicers and client*/
|
||||||
#define CFG_USE_DHCP 1
|
#define CFG_USE_DHCP 0//1
|
||||||
#define CFG_USE_DHCPD 1 // for servicers in ap mode
|
#define CFG_USE_DHCPD 0//1 // for servicers in ap mode
|
||||||
|
|
||||||
/*section 11-----temperature detect*/
|
/*section 11-----temperature detect*/
|
||||||
#define CFG_USE_TEMPERATURE_DETECT 1
|
#define CFG_USE_TEMPERATURE_DETECT 1
|
||||||
@ -248,10 +248,10 @@
|
|||||||
|
|
||||||
#if CFG_WIFI_P2P
|
#if CFG_WIFI_P2P
|
||||||
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
|
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
|
||||||
#define CFG_USE_CAMERA_INTF 1
|
#define CFG_USE_CAMERA_INTF 0
|
||||||
#else
|
#else
|
||||||
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
|
#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0
|
||||||
#define CFG_USE_CAMERA_INTF 1
|
#define CFG_USE_CAMERA_INTF 0
|
||||||
#endif
|
#endif
|
||||||
#define CFG_USE_HSLAVE_SPI 0
|
#define CFG_USE_HSLAVE_SPI 0
|
||||||
#define CFG_USE_SPIDMA 0
|
#define CFG_USE_SPIDMA 0
|
||||||
@ -323,9 +323,9 @@
|
|||||||
|
|
||||||
/*section 21 ----- support ota*/
|
/*section 21 ----- support ota*/
|
||||||
#if( ( CFG_SUPPORT_ALIOS ) || ( CFG_SUPPORT_RTT ) || (CFG_SUPPORT_MATTER == 1))
|
#if( ( CFG_SUPPORT_ALIOS ) || ( CFG_SUPPORT_RTT ) || (CFG_SUPPORT_MATTER == 1))
|
||||||
#define CFG_SUPPORT_OTA_HTTP 1
|
#define CFG_SUPPORT_OTA_HTTP 0
|
||||||
#else
|
#else
|
||||||
#define CFG_SUPPORT_OTA_HTTP 1
|
#define CFG_SUPPORT_OTA_HTTP 0
|
||||||
#endif
|
#endif
|
||||||
#define CFG_SUPPORT_OTA_TFTP 0
|
#define CFG_SUPPORT_OTA_TFTP 0
|
||||||
|
|
||||||
@ -421,7 +421,7 @@
|
|||||||
#undef CFG_MBEDTLS
|
#undef CFG_MBEDTLS
|
||||||
#define CFG_MBEDTLS 1
|
#define CFG_MBEDTLS 1
|
||||||
#endif
|
#endif
|
||||||
#define CFG_USE_I2S 1
|
#define CFG_USE_I2S 0
|
||||||
|
|
||||||
/* watchdog, freertos only */
|
/* watchdog, freertos only */
|
||||||
#define CFG_INT_WDG_ENABLED 1
|
#define CFG_INT_WDG_ENABLED 1
|
||||||
@ -430,10 +430,10 @@
|
|||||||
#define CFG_TASK_WDG_PERIOD_MS 60000
|
#define CFG_TASK_WDG_PERIOD_MS 60000
|
||||||
|
|
||||||
/*section 29 ----- peripheral interface open */
|
/*section 29 ----- peripheral interface open */
|
||||||
#define CFG_USE_SPI 1
|
#define CFG_USE_SPI 0
|
||||||
#define CFG_USE_SPI_MASTER 1
|
#define CFG_USE_SPI_MASTER 0
|
||||||
#define CFG_USE_SPI_SLAVE 1
|
#define CFG_USE_SPI_SLAVE 0
|
||||||
#define CFG_USE_SPI_DMA 1
|
#define CFG_USE_SPI_DMA 0
|
||||||
|
|
||||||
/*section 30 ----- peripheral interface test case */
|
/*section 30 ----- peripheral interface test case */
|
||||||
#define CFG_PERIPHERAL_TEST 0
|
#define CFG_PERIPHERAL_TEST 0
|
||||||
|
@ -1152,6 +1152,7 @@ static void app_demo_softap_rw_connected_event_func(void)
|
|||||||
|
|
||||||
int beken_wlan_hw_init(void)
|
int beken_wlan_hw_init(void)
|
||||||
{
|
{
|
||||||
|
if(1){
|
||||||
struct rt_wlan_device *wlan = RT_NULL;
|
struct rt_wlan_device *wlan = RT_NULL;
|
||||||
struct beken_wifi_info *wifi_info = RT_NULL;
|
struct beken_wifi_info *wifi_info = RT_NULL;
|
||||||
rt_err_t result = RT_EOK;
|
rt_err_t result = RT_EOK;
|
||||||
@ -1184,6 +1185,7 @@ int beken_wlan_hw_init(void)
|
|||||||
#endif
|
#endif
|
||||||
bk_wlan_status_register_cb(wlan_event_handle);
|
bk_wlan_status_register_cb(wlan_event_handle);
|
||||||
rt_kprintf("beken wlan hw init\r\n");
|
rt_kprintf("beken wlan hw init\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@
|
|||||||
#define PKG_USING_WEBCLIENT
|
#define PKG_USING_WEBCLIENT
|
||||||
#define WEBCLIENT_HEADER_BUFSZ 4096
|
#define WEBCLIENT_HEADER_BUFSZ 4096
|
||||||
#define WEBCLIENT_RESPONSE_BUFSZ 4096
|
#define WEBCLIENT_RESPONSE_BUFSZ 4096
|
||||||
#define PKG_USING_WEBCLIENT_LATEST_VERSION
|
//#define PKG_USING_WEBCLIENT_LATEST_VERSION
|
||||||
//#define PKG_USING_CJSON
|
//#define PKG_USING_CJSON
|
||||||
#define PKG_USING_CJSON_V102
|
#define PKG_USING_CJSON_V102
|
||||||
|
|
||||||
@ -279,7 +279,7 @@
|
|||||||
#define BEKEN_USING_UART2
|
#define BEKEN_USING_UART2
|
||||||
#define BEKEN_USING_WDT
|
#define BEKEN_USING_WDT
|
||||||
#define BEKEN_USING_FLASH
|
#define BEKEN_USING_FLASH
|
||||||
#define BEKEN_USING_PWM
|
//#define BEKEN_USING_PWM
|
||||||
#define BEKEN_USING_GPIO
|
#define BEKEN_USING_GPIO
|
||||||
#define BEKEN_USING_WLAN
|
#define BEKEN_USING_WLAN
|
||||||
#define LWIP_NETIF_HOSTNAME 1
|
#define LWIP_NETIF_HOSTNAME 1
|
||||||
@ -296,7 +296,7 @@
|
|||||||
#define PKG_USING_PLAYER
|
#define PKG_USING_PLAYER
|
||||||
#define PKG_USING_PLAYER_V127
|
#define PKG_USING_PLAYER_V127
|
||||||
#define PLAYER_DEVICE "sound"
|
#define PLAYER_DEVICE "sound"
|
||||||
#define PLAYER_DEFAULT_VOLUME 65
|
#define PLAYER_DEFAULT_VOLUME 0
|
||||||
|
|
||||||
/* PLAYER <20>ڲ<EFBFBD>֧<EFBFBD><D6A7> CODEC */
|
/* PLAYER <20>ڲ<EFBFBD>֧<EFBFBD><D6A7> CODEC */
|
||||||
//#define PLAYER_ENABLE_CODEC_PCM /* PCM<43><4D><EFBFBD><EFBFBD> */
|
//#define PLAYER_ENABLE_CODEC_PCM /* PCM<43><4D><EFBFBD><EFBFBD> */
|
||||||
@ -318,7 +318,7 @@
|
|||||||
#define PLAYER_USING_DEBUG 0 /* 0:<3A><><EFBFBD><EFBFBD><EFBFBD>汾, 1:<3A><><EFBFBD>汾 */
|
#define PLAYER_USING_DEBUG 0 /* 0:<3A><><EFBFBD><EFBFBD><EFBFBD>汾, 1:<3A><><EFBFBD>汾 */
|
||||||
|
|
||||||
/* PLAYER Example */
|
/* PLAYER Example */
|
||||||
//#define PLAYER_USING_EXAMPLE00
|
#define PLAYER_USING_EXAMPLE00
|
||||||
//#define PLAYER_USING_EXAMPLE02
|
//#define PLAYER_USING_EXAMPLE02
|
||||||
//#define PLAYER_USING_EXAMPLE03
|
//#define PLAYER_USING_EXAMPLE03
|
||||||
/* PLAYER END **************************************************************************** */
|
/* PLAYER END **************************************************************************** */
|
||||||
@ -327,12 +327,12 @@
|
|||||||
|
|
||||||
/* Test samples */
|
/* Test samples */
|
||||||
|
|
||||||
//#define PKG_USING_RT_OTA
|
#define PKG_USING_RT_OTA
|
||||||
|
|
||||||
#define RT_USING_PTHREADS
|
#define RT_USING_PTHREADS
|
||||||
|
|
||||||
/* voice changer */
|
/* voice changer */
|
||||||
#define CONFIG_VOICE_CHANGER 0
|
//#define CONFIG_VOICE_CHANGER 0
|
||||||
|
|
||||||
/* tools packages */
|
/* tools packages */
|
||||||
#define PKG_USING_EASYFLASH
|
#define PKG_USING_EASYFLASH
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#define HTTP_OTA_BUFF_LEN 4096
|
#define HTTP_OTA_BUFF_LEN 4096
|
||||||
#define HTTP_OTA_DL_DELAY (10 * RT_TICK_PER_SECOND)
|
#define HTTP_OTA_DL_DELAY (10 * RT_TICK_PER_SECOND)
|
||||||
|
|
||||||
#define HTTP_OTA_URL "http://192.168.10.135:80/rtthread.rbl"
|
#define HTTP_OTA_URL "http://192.168.7.105:8080/all_2M.1220.bin"
|
||||||
|
|
||||||
static void print_progress(size_t cur_size, size_t total_size)
|
static void print_progress(size_t cur_size, size_t total_size)
|
||||||
{
|
{
|
||||||
@ -127,6 +127,8 @@ static int http_ota_fw_download(const char *uri)
|
|||||||
// Check if the OTA file is too large
|
// Check if the OTA file is too large
|
||||||
if (session->content_length > dl_part->len)
|
if (session->content_length > dl_part->len)
|
||||||
{
|
{
|
||||||
|
rt_kprintf("dl_part->len : %d\n", dl_part->len);
|
||||||
|
rt_kprintf("session->content_length : %d\n", session->content_length);
|
||||||
LOG_E("Firmware download failed! OTA file is too big!");
|
LOG_E("Firmware download failed! OTA file is too big!");
|
||||||
goto __exit;
|
goto __exit;
|
||||||
}
|
}
|
||||||
@ -192,7 +194,7 @@ static int http_ota_fw_download(const char *uri)
|
|||||||
log_i("OTA file raw size %d bytes.", raw_size);
|
log_i("OTA file raw size %d bytes.", raw_size);
|
||||||
|
|
||||||
// Gets the describe partition name of the OTA file
|
// Gets the describe partition name of the OTA file
|
||||||
rt_strncpy(desc_part_name, &buffer_read[12], 16);
|
rt_strncpy(desc_part_name, (const char *)&buffer_read[12], 16);
|
||||||
|
|
||||||
/* dump new firmware info. */
|
/* dump new firmware info. */
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
//#define RT_USING_AIRKISS
|
//#define RT_USING_AIRKISS
|
||||||
|
|
||||||
/*http ota sample */
|
/*http ota sample */
|
||||||
//#define SAMPLE_USING_OTA_HTTP
|
#define SAMPLE_USING_OTA_HTTP
|
||||||
|
|
||||||
/* web net sample */
|
/* web net sample */
|
||||||
//#define WEBNET_SAMPLE
|
//#define WEBNET_SAMPLE
|
||||||
|
@ -44,7 +44,7 @@ out_json_2M = {
|
|||||||
"version": "2M.1220",
|
"version": "2M.1220",
|
||||||
"partition": "app",
|
"partition": "app",
|
||||||
"start_addr": "0x00011000",
|
"start_addr": "0x00011000",
|
||||||
"size": "1156K"
|
"size": "1156K"#1020k
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user