mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2025-10-29 19:43:22 +00:00
parent
437bd68daa
commit
d4d6c69be3
5
.github/workflows/workflow.yaml
vendored
5
.github/workflows/workflow.yaml
vendored
@ -55,7 +55,6 @@ jobs:
|
||||
echo "sha_short=SHA-$(git rev-parse --short=12 HEAD)" >> $GITHUB_OUTPUT
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
build2:
|
||||
name: Build Simulator
|
||||
needs: refs
|
||||
@ -99,7 +98,7 @@ jobs:
|
||||
with:
|
||||
name: ${{ env.APP_NAME }}_${{ needs.refs.outputs.version }}_sim
|
||||
path: output/${{ needs.refs.outputs.version }}/obkSimulator_${{ needs.refs.outputs.version }}.zip
|
||||
|
||||
|
||||
build:
|
||||
name: Build
|
||||
needs: refs
|
||||
@ -107,7 +106,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [OpenBK7231T, OpenBK7231N, OpenXR809, OpenBL602, OpenW800, OpenW600, OpenLN882H, OpenTR6260, OpenRTL87X0C, OpenRTL8710B, OpenRTL8710A]
|
||||
platform: [OpenBK7231T, OpenBK7231N, OpenXR809, OpenBL602, OpenW800, OpenW600, OpenLN882H, OpenTR6260, OpenRTL87X0C, OpenRTL8710B, OpenRTL8710A, OpenBK7238]
|
||||
steps:
|
||||
- name: Source checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -41,3 +41,7 @@
|
||||
path = sdk/OpenRTL8710A_B
|
||||
url = https://github.com/NonPIayerCharacter/OpenRTL8710A_B.git
|
||||
branch = master
|
||||
[submodule "sdk/beken_freertos_sdk"]
|
||||
path = sdk/beken_freertos_sdk
|
||||
url = https://github.com/NonPIayerCharacter/beken_freertos_sdk.git
|
||||
branch = master
|
||||
|
||||
37
Makefile
37
Makefile
@ -35,7 +35,7 @@ else
|
||||
endif
|
||||
|
||||
update-submodules: submodules
|
||||
git add sdk/OpenBK7231T sdk/OpenBK7231N sdk/OpenXR809 sdk/OpenBL602 sdk/OpenW800 sdk/OpenW600 sdk/OpenLN882H sdk/esp-idf sdk/OpenTR6260
|
||||
git add sdk/OpenBK7231T sdk/OpenBK7231N sdk/OpenXR809 sdk/OpenBL602 sdk/OpenW800 sdk/OpenW600 sdk/OpenLN882H sdk/esp-idf sdk/OpenTR6260 sdk/beken_freertos_sdk
|
||||
ifdef GITHUB_ACTIONS
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
@ -76,7 +76,7 @@ sdk/OpenLN882H/project/OpenBeken/app:
|
||||
|
||||
.PHONY: prebuild_OpenBK7231N prebuild_OpenBK7231T prebuild_OpenBL602 prebuild_OpenLN882H
|
||||
.PHONY: prebuild_OpenW600 prebuild_OpenW800 prebuild_OpenXR809 prebuild_ESPIDF prebuild_OpenTR6260
|
||||
.PHONY: prebuild_OpenRTL87X0C
|
||||
.PHONY: prebuild_OpenRTL87X0C prebuild_OpenBK7238 prebuild_OpenBK7231N_ALT
|
||||
|
||||
prebuild_OpenBK7231N:
|
||||
git submodule update --init --recursive sdk/OpenBK7231N
|
||||
@ -178,6 +178,22 @@ prebuild_OpenRTL8710A:
|
||||
else echo "prebuild for OpenRTL8710A not found ... "; \
|
||||
fi
|
||||
|
||||
prebuild_OpenBK7238:
|
||||
git submodule update --init --recursive sdk/beken_freertos_sdk
|
||||
@if [ -e platforms/BK723x/pre_build_7238.sh ]; then \
|
||||
echo "prebuild found for OpenBK7238"; \
|
||||
sh platforms/BK723x/pre_build_7238.sh; \
|
||||
else echo "prebuild for OpenBK7238 not found ... "; \
|
||||
fi
|
||||
|
||||
prebuild_OpenBK7231N_ALT:
|
||||
git submodule update --init --recursive sdk/beken_freertos_sdk
|
||||
@if [ -e platforms/BK723x/pre_build_7231n.sh ]; then \
|
||||
echo "prebuild found for OpenBK7231N"; \
|
||||
sh platforms/BK723x/pre_build_7231n.sh; \
|
||||
else echo "prebuild for OpenBK7231N not found ... "; \
|
||||
fi
|
||||
|
||||
# Build main binaries
|
||||
OpenBK7231T: prebuild_OpenBK7231T
|
||||
$(MAKE) APP_NAME=OpenBK7231T TARGET_PLATFORM=bk7231t SDK_PATH=sdk/OpenBK7231T APPS_BUILD_PATH=../bk7231t_os build-BK7231
|
||||
@ -338,6 +354,22 @@ OpenRTL8710A: prebuild_OpenRTL8710A
|
||||
cp sdk/OpenRTL8710A_B/project/obk_ameba1/GCC-RELEASE/application/Debug/bin/ram_all.bin output/$(APP_VERSION)/OpenRTL8710A_$(APP_VERSION).bin
|
||||
cp sdk/OpenRTL8710A_B/project/obk_ameba1/GCC-RELEASE/application/Debug/bin/ota.bin output/$(APP_VERSION)/OpenRTL8710A_$(APP_VERSION)_ota.img
|
||||
|
||||
.PHONY: OpenBK7238
|
||||
OpenBK7238: prebuild_OpenBK7238
|
||||
cd sdk/beken_freertos_sdk && sh build.sh bk7238 $(APP_VERSION)
|
||||
mkdir -p output/$(APP_VERSION)
|
||||
cp sdk/beken_freertos_sdk/out/all_2M.1220.bin output/$(APP_VERSION)/OpenBK7238_QIO_${APP_VERSION}.bin
|
||||
cp sdk/beken_freertos_sdk/out/app.rbl output/$(APP_VERSION)/OpenBK7238_${APP_VERSION}.rbl
|
||||
cp sdk/beken_freertos_sdk/out/bk7238_bsp_uart_2M.1220.bin output/$(APP_VERSION)/OpenBK7238_UA_${APP_VERSION}.bin
|
||||
|
||||
.PHONY: OpenBK7231N_ALT
|
||||
OpenBK7231N_ALT: prebuild_OpenBK7231N_ALT
|
||||
cd sdk/beken_freertos_sdk && sh build.sh bk7231n $(APP_VERSION)
|
||||
mkdir -p output/$(APP_VERSION)
|
||||
cp sdk/beken_freertos_sdk/out/all_2M.1220.bin output/$(APP_VERSION)/OpenBK7231N_ALT_QIO_${APP_VERSION}.bin
|
||||
cp sdk/beken_freertos_sdk/out/app.rbl output/$(APP_VERSION)/OpenBK7231N_ALT_${APP_VERSION}.rbl
|
||||
cp sdk/beken_freertos_sdk/out/bk7231n_bsp_uart_2M.1220.bin output/$(APP_VERSION)/OpenBK7231N_ALT_UA_${APP_VERSION}.bin
|
||||
|
||||
# clean .o files and output directory
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@ -351,6 +383,7 @@ clean:
|
||||
$(MAKE) -C sdk/OpenRTL87X0C/project/OpenBeken/GCC-RELEASE clean
|
||||
$(MAKE) -C sdk/OpenRTL8710A_B/project/obk_amebaz/GCC-RELEASE clean
|
||||
$(MAKE) -C sdk/OpenRTL8710A_B/project/obk_ameba1/GCC-RELEASE clean
|
||||
$(MAKE) -C sdk/beken_freertos_sdk clean
|
||||
test -d ./sdk/OpenLN882H/build && cmake --build ./sdk/OpenLN882H/build --target clean
|
||||
test -d ./platforms/ESP-IDF/build-32 && cmake --build ./platforms/ESP-IDF/build-32 --target clean
|
||||
test -d ./platforms/ESP-IDF/build-c3 && cmake --build ./platforms/ESP-IDF/build-c3 --target clean
|
||||
|
||||
157
platforms/BK723x/OpenBeken.mk
Normal file
157
platforms/BK723x/OpenBeken.mk
Normal file
@ -0,0 +1,157 @@
|
||||
OBK_DIR = ./app
|
||||
|
||||
INCLUDES += -I$(OBK_DIR)/../include
|
||||
INCLUDES += -I./fixes
|
||||
|
||||
CCFLAGS += -DPLATFORM_BEKEN -DPLATFORM_BEKEN_NEW
|
||||
|
||||
ifdef USER_SW_VER
|
||||
CCFLAGS += -DUSER_SW_VER='"${USER_SW_VER}"'
|
||||
endif
|
||||
|
||||
ifeq ($(CFG_SOC_NAME), 1)
|
||||
CFLAGS += -DPLATFORM_BK7231T
|
||||
else ifeq ($(CFG_SOC_NAME), 2)
|
||||
CCFLAGS += -DPLATFORM_BK7231U
|
||||
else ifeq ($(CFG_SOC_NAME), 3)
|
||||
CCFLAGS += -DPLATFORM_BK7251
|
||||
else ifeq ($(CFG_SOC_NAME), 5)
|
||||
CCFLAGS += -DPLATFORM_BK7231N
|
||||
else ifeq ($(CFG_SOC_NAME), 7)
|
||||
CCFLAGS += -DPLATFORM_BK7238
|
||||
endif
|
||||
|
||||
APP_C += $(OBK_DIR)/../platforms/BK723x/ps.c
|
||||
|
||||
APP_C += $(OBK_DIR)/base64/base64.c
|
||||
APP_C += $(OBK_DIR)/bitmessage/bitmessage_read.c
|
||||
APP_C += $(OBK_DIR)/bitmessage/bitmessage_write.c
|
||||
APP_C += $(OBK_DIR)/cJSON/cJSON.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_channels.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_eventHandlers.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_if.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_main.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_newLEDDriver_colors.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_newLEDDriver.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_repeatingEvents.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_script.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_simulatorOnly.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_tasmota.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_tcp.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_test.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_tokenizer.c
|
||||
APP_C += $(OBK_DIR)/devicegroups/deviceGroups_read.c
|
||||
APP_C += $(OBK_DIR)/devicegroups/deviceGroups_util.c
|
||||
APP_C += $(OBK_DIR)/devicegroups/deviceGroups_write.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_main.c
|
||||
APP_C += $(OBK_DIR)/hal/bk7231/hal_adc_bk7231.c
|
||||
APP_C += $(OBK_DIR)/hal/bk7231/hal_flashConfig_bk7231.c
|
||||
APP_C += $(OBK_DIR)/hal/bk7231/hal_flashVars_bk7231.c
|
||||
APP_C += $(OBK_DIR)/hal/bk7231/hal_generic_bk7231.c
|
||||
APP_C += $(OBK_DIR)/hal/bk7231/hal_main_bk7231.c
|
||||
APP_C += $(OBK_DIR)/hal/bk7231/hal_pins_bk7231.c
|
||||
APP_C += $(OBK_DIR)/hal/bk7231/hal_wifi_bk7231.c
|
||||
APP_C += $(OBK_DIR)/hal/bk7231/hal_uart_bk7231.c
|
||||
APP_C += $(OBK_DIR)/httpserver/hass.c
|
||||
APP_C += $(OBK_DIR)/httpserver/http_basic_auth.c
|
||||
APP_C += $(OBK_DIR)/httpserver/http_fns.c
|
||||
APP_C += $(OBK_DIR)/httpserver/new_tcp_server.c
|
||||
#APP_C += $(OBK_DIR)/httpserver/http_tcp_server.c
|
||||
APP_C += $(OBK_DIR)/httpserver/json_interface.c
|
||||
APP_C += $(OBK_DIR)/httpserver/new_http.c
|
||||
APP_C += $(OBK_DIR)/httpserver/rest_interface.c
|
||||
APP_C += $(OBK_DIR)/mqtt/new_mqtt_deduper.c
|
||||
APP_C += $(OBK_DIR)/jsmn/jsmn.c
|
||||
APP_C += $(OBK_DIR)/logging/logging.c
|
||||
APP_C += $(OBK_DIR)/mqtt/new_mqtt.c
|
||||
APP_C += $(OBK_DIR)/new_cfg.c
|
||||
APP_C += $(OBK_DIR)/new_common.c
|
||||
APP_C += $(OBK_DIR)/new_ping.c
|
||||
APP_C += $(OBK_DIR)/new_pins.c
|
||||
APP_C += $(OBK_DIR)/rgb2hsv.c
|
||||
APP_C += $(OBK_DIR)/tiny_crc8.c
|
||||
APP_C += $(OBK_DIR)/user_main.c
|
||||
APP_C += $(OBK_DIR)/cmnds/cmd_send.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_adcButton.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_adcSmoother.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_aht2x.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_battery.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_bl_shared.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_bl0937.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_bl0942.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_bmp280.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_bmpi2c.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_bp1658cj.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_bp5758d.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_bridge_driver.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_chargingLimit.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_charts.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_cht8305.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_cse7766.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_ddp.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_debouncer.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_dht_internal.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_dht.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_doorSensorWithDeepSleep.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_gn6932.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_hd2015.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_ht16k33.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_httpButtons.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_hue.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_kp18058.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_kp18068.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_max72xx_clock.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_max72xx_internal.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_max72xx_single.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_mcp9808.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_ntp_events.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_ntp.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_pt6523.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_pwm_groups.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_pwmToggler.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_pwrCal.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_rn8209.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_sgp.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_shiftRegister.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_sht3x.c
|
||||
#APP_C += $(OBK_DIR)/driver/drv_sm15155e.c
|
||||
#APP_C += $(OBK_DIR)/driver/drv_sm16703P.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_sm2135.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_sm2235.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_soft_i2c.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_soft_spi.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_spi_flash.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_spi.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_spidma.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_ssdp.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_tasmotaDeviceGroups.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_test_drivers.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_textScroller.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_tm_gn_display_shared.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_tm1637.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_tm1638.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_tuyaMCU.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_tuyaMCUSensor.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_uart.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_ucs1912.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_wemo.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_ds1820_simple.c
|
||||
APP_C += $(OBK_DIR)/httpclient/http_client.c
|
||||
APP_C += $(OBK_DIR)/httpclient/utils_net.c
|
||||
APP_C += $(OBK_DIR)/httpclient/utils_timer.c
|
||||
APP_C += $(OBK_DIR)/i2c/drv_i2c_lcd_pcf8574t.c
|
||||
APP_C += $(OBK_DIR)/i2c/drv_i2c_main.c
|
||||
APP_C += $(OBK_DIR)/i2c/drv_i2c_mcp23017.c
|
||||
APP_C += $(OBK_DIR)/i2c/drv_i2c_tc74.c
|
||||
APP_C += $(OBK_DIR)/littlefs/lfs_util.c
|
||||
APP_C += $(OBK_DIR)/littlefs/lfs.c
|
||||
APP_C += $(OBK_DIR)/littlefs/our_lfs.c
|
||||
APP_C += $(OBK_DIR)/memory/memtest.c
|
||||
APP_C += $(OBK_DIR)/ota/ota.c
|
||||
APP_C += $(OBK_DIR)/sim/sim_uart.c
|
||||
APP_C += $(OBK_DIR)/driver/drv_ir2.c
|
||||
#APP_C += $(OBK_DIR)/driver/drv_pixelAnim.c
|
||||
|
||||
SRC_C += ./fixes/blank.c
|
||||
|
||||
APP_CXX += $(OBK_DIR)/driver/drv_ir.cpp
|
||||
123
platforms/BK723x/ps.c
Normal file
123
platforms/BK723x/ps.c
Normal file
@ -0,0 +1,123 @@
|
||||
#include "include.h"
|
||||
#include "rw_pub.h"
|
||||
#include "vif_mgmt.h"
|
||||
#include "sa_station.h"
|
||||
#include "param_config.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
#include "driver_beken.h"
|
||||
#include "mac_ie.h"
|
||||
#include "sa_ap.h"
|
||||
#include "main_none.h"
|
||||
#include "sm.h"
|
||||
#include "mac.h"
|
||||
#include "sm_task.h"
|
||||
#include "scan_task.h"
|
||||
#include "hal_machw.h"
|
||||
#include "error.h"
|
||||
#include "lwip_netif_address.h"
|
||||
#include "lwip/inet.h"
|
||||
#include <stdbool.h>
|
||||
#include "rw_pub.h"
|
||||
#include "power_save_pub.h"
|
||||
#include "rwnx.h"
|
||||
#include "net.h"
|
||||
#include "mm_bcn.h"
|
||||
#include "mm_task.h"
|
||||
#include "mcu_ps_pub.h"
|
||||
#include "manual_ps_pub.h"
|
||||
#include "gpio_pub.h"
|
||||
#include "phy_trident.h"
|
||||
#include "rw_msg_rx.h"
|
||||
#include "app.h"
|
||||
#include "ate_app.h"
|
||||
#include "wdt_pub.h"
|
||||
#include "start_type_pub.h"
|
||||
#include "wpa_psk_cache.h"
|
||||
#include "drv_model_pub.h"
|
||||
#include "str_pub.h"
|
||||
|
||||
#if CFG_WPA_CTRL_IFACE
|
||||
#include "wlan_defs_pub.h"
|
||||
#include "wpa_ctrl.h"
|
||||
#include "flash_pub.h"
|
||||
#endif
|
||||
|
||||
#if CFG_ROLE_LAUNCH
|
||||
#include "role_launch.h"
|
||||
#endif
|
||||
|
||||
#if (FAST_CONNECT_INFO_ENC_METHOD != ENC_METHOD_NULL)
|
||||
#include "soft_encrypt.h"
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_OTA_HTTP
|
||||
#include "utils_httpc.h"
|
||||
#endif
|
||||
|
||||
#include "bk7011_cal_pub.h"
|
||||
#include "target_util_pub.h"
|
||||
#include "wlan_ui_pub.h"
|
||||
#if CFG_WIFI_P2P
|
||||
#include "video_demo_pub.h"
|
||||
#include "rw_ieee80211.h"
|
||||
//#include "sys.h"
|
||||
#endif
|
||||
#include "low_voltage_ps.h"
|
||||
#include "intc_pub.h"
|
||||
#include "arm_arch.h"
|
||||
|
||||
BK_PS_LEVEL global_ps_level = 0;
|
||||
int bk_wlan_power_save_set_level(BK_PS_LEVEL level)
|
||||
{
|
||||
if(level & PS_DEEP_SLEEP_BIT)
|
||||
{
|
||||
#if CFG_USE_STA_PS
|
||||
if(global_ps_level & PS_RF_SLEEP_BIT)
|
||||
{
|
||||
bk_wlan_dtim_rf_ps_mode_disable();
|
||||
}
|
||||
#endif
|
||||
#if CFG_USE_MCU_PS
|
||||
if(global_ps_level & PS_MCU_SLEEP_BIT)
|
||||
{
|
||||
bk_wlan_mcu_ps_mode_disable();
|
||||
}
|
||||
#endif
|
||||
rtos_delay_milliseconds(100);
|
||||
#if CFG_USE_DEEP_PS
|
||||
/// bk_enter_deep_sleep(0xc000,0x0);
|
||||
#endif
|
||||
}
|
||||
|
||||
if((global_ps_level & PS_RF_SLEEP_BIT) ^ (level & PS_RF_SLEEP_BIT))
|
||||
{
|
||||
#if CFG_USE_STA_PS
|
||||
if(global_ps_level & PS_RF_SLEEP_BIT)
|
||||
{
|
||||
bk_wlan_dtim_rf_ps_mode_disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
bk_wlan_dtim_rf_ps_mode_enable();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if((global_ps_level & PS_MCU_SLEEP_BIT) ^ (level & PS_MCU_SLEEP_BIT))
|
||||
{
|
||||
#if CFG_USE_MCU_PS
|
||||
if(global_ps_level & PS_MCU_SLEEP_BIT)
|
||||
{
|
||||
bk_wlan_mcu_ps_mode_disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
bk_wlan_mcu_ps_mode_enable();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
global_ps_level = level;
|
||||
|
||||
return 0;
|
||||
}
|
||||
1
sdk/beken_freertos_sdk
Submodule
1
sdk/beken_freertos_sdk
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit d3930afaa00ff815caa6b462b7f7a596001d32b6
|
||||
@ -40,6 +40,10 @@ extern void rtw_enable_wlan_low_pwr_mode(WLAN_LOW_PW_MODE mode);
|
||||
#endif
|
||||
#include "wifi_conf.h"
|
||||
int g_sleepfactor = 1;
|
||||
#elif PLATFORM_BEKEN_NEW
|
||||
#include "co_math.h"
|
||||
#include "manual_ps_pub.h"
|
||||
#include "wlan_ui_pub.h"
|
||||
#endif
|
||||
|
||||
#define HASH_SIZE 128
|
||||
@ -102,7 +106,7 @@ static commandResult_t CMD_PowerSave(const void* context, const char* cmd, const
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PLATFORM_BEKEN
|
||||
#if defined(PLATFORM_BEKEN)
|
||||
extern int bk_wlan_power_save_set_level(BK_PS_LEVEL level);
|
||||
if (bOn) {
|
||||
bk_wlan_power_save_set_level(/*PS_DEEP_SLEEP_BIT */ PS_RF_SLEEP_BIT | PS_MCU_SLEEP_BIT);
|
||||
@ -237,7 +241,7 @@ static commandResult_t CMD_DeepSleep(const void* context, const char* cmd, const
|
||||
}
|
||||
|
||||
timeMS = Tokenizer_GetArgInteger(0);
|
||||
#ifdef PLATFORM_BEKEN
|
||||
#if defined(PLATFORM_BEKEN) && !defined(PLATFORM_BEKEN_NEW)
|
||||
// It requires a define in SDK file:
|
||||
// OpenBK7231T\platforms\bk7231t\bk7231t_os\beken378\func\include\manual_ps_pub.h
|
||||
// define there:
|
||||
@ -245,6 +249,13 @@ static commandResult_t CMD_DeepSleep(const void* context, const char* cmd, const
|
||||
extern void bk_wlan_ps_wakeup_with_timer(UINT32 sleep_time);
|
||||
bk_wlan_ps_wakeup_with_timer(timeMS);
|
||||
return CMD_RES_OK;
|
||||
#elif defined(PLATFORM_BEKEN_NEW)
|
||||
PS_DEEP_CTRL_PARAM params;
|
||||
params.sleep_mode = MANUAL_MODE_IDLE;
|
||||
params.wake_up_way = PS_DEEP_WAKEUP_RTC;
|
||||
params.sleep_time = timeMS;
|
||||
bk_enter_deep_sleep_mode(¶ms);
|
||||
return CMD_RES_OK;
|
||||
#elif defined(PLATFORM_W600)
|
||||
#elif defined(PLATFORM_ESPIDF)
|
||||
esp_sleep_enable_timer_wakeup(timeMS * 1000000);
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
#include "../httpserver/new_http.h"
|
||||
#include "../hal/hal_pins.h"
|
||||
|
||||
#ifdef ENABLE_DRIVER_BMP280
|
||||
|
||||
static int32_t g_temperature;
|
||||
static uint32_t g_pressure, g_humidity;
|
||||
static char g_targetChannelTemperature = -1, g_targetChannelPressure = -1, g_targetChannelHumidity = -1;
|
||||
@ -99,3 +101,4 @@ void BMP280_AppendInformationToHTTPIndexPage(http_request_t* request)
|
||||
hprintf255(request, "</h2>");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -415,7 +415,7 @@ extern "C" void DRV_IR_ISR(UINT8 t){
|
||||
duty = 0;
|
||||
}
|
||||
}
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
bk_pwm_update_param((bk_pwm_t)pIRsend->pwmIndex, pIRsend->pwmperiod, duty,0,0);
|
||||
#else
|
||||
bk_pwm_update_param((bk_pwm_t)pIRsend->pwmIndex, pIRsend->pwmperiod, duty);
|
||||
@ -644,7 +644,7 @@ extern "C" void DRV_IR_Init(){
|
||||
uint32_t pwmfrequency = 38000;
|
||||
uint32_t period = (26000000 / pwmfrequency);
|
||||
uint32_t duty = period/2;
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
// OSStatus bk_pwm_initialize(bk_pwm_t pwm, uint32_t frequency, uint32_t duty_cycle);
|
||||
bk_pwm_initialize((bk_pwm_t)pwmIndex, period, duty, 0, 0);
|
||||
#else
|
||||
|
||||
@ -27,8 +27,11 @@
|
||||
#include "../../beken378/driver/gpio/gpio.h"
|
||||
#include "../../beken378/driver/pwm/pwm.h"
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BEKEN_NEW
|
||||
#include "pwm_bk7231n.h"
|
||||
#else
|
||||
#include "../../beken378/driver/pwm/pwm_new.h"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define REG_PWM_BASE_ADDR (0x00802B00UL)
|
||||
@ -231,7 +234,7 @@ static commandResult_t CMD_IR2_SendIR2(const void* context, const char* cmd, con
|
||||
ADDLOG_INFO(LOG_FEATURE_IR, "Queue size %i",(stop - times));
|
||||
|
||||
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
bk_pwm_update_param((bk_pwm_t)pwmIndex, period, duty_off, 0, 0);
|
||||
#else
|
||||
bk_pwm_update_param((bk_pwm_t)pwmIndex, period, duty_off);
|
||||
@ -276,7 +279,7 @@ static commandResult_t CMD_IR2_SetupIR2(const void* context, const char* cmd, co
|
||||
}
|
||||
#endif
|
||||
#ifndef WINDOWS
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
// OSStatus bk_pwm_initialize(bk_pwm_t pwm, uint32_t frequency, uint32_t duty_cycle);
|
||||
bk_pwm_initialize((bk_pwm_t)pwmIndex, period, period/2, 0, 0);
|
||||
#else
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
#include "../../beken378/func/user_driver/armino/spi/spi.h"
|
||||
#else
|
||||
// spi_config_t and its member types are copied from BK7321N SPI implementation.
|
||||
#include "drv_spi.h"
|
||||
#if PLATFORM_BK7231T
|
||||
#if PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
#include "../../../../platforms/bk7231t/bk7231t_os/beken378/common/typedef.h"
|
||||
#include "../../../../platforms/bk7231t/bk7231t_os/beken378/driver/entry/arch.h"
|
||||
#include "../../../../platforms/bk7231t/bk7231t_os/beken378/driver/include/drv_model_pub.h"
|
||||
@ -17,9 +17,9 @@
|
||||
#include "../logging/logging.h"
|
||||
|
||||
int SPI_DriverInit(void) {
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
return bk_spi_driver_init();
|
||||
#elif PLATFORM_BK7231T
|
||||
#elif PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
// Is called in dd.c
|
||||
// spi_init();
|
||||
return 0;
|
||||
@ -30,9 +30,9 @@ int SPI_DriverInit(void) {
|
||||
}
|
||||
|
||||
int SPI_DriverDeinit(void) {
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
return bk_spi_driver_deinit();
|
||||
#elif PLATFORM_BK7231T
|
||||
#elif PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
// Is called in dd.c
|
||||
// spi_exit();
|
||||
return 0;
|
||||
@ -43,9 +43,9 @@ int SPI_DriverDeinit(void) {
|
||||
}
|
||||
|
||||
int SPI_Init(const spi_config_t *config) {
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
return bk_spi_init(0, config);
|
||||
#elif PLATFORM_BK7231T
|
||||
#elif PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
int err = 0;
|
||||
|
||||
uint32_t param = PWD_SPI_CLK_BIT;
|
||||
@ -100,9 +100,9 @@ int SPI_Init(const spi_config_t *config) {
|
||||
}
|
||||
|
||||
int SPI_Deinit(void) {
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
return bk_spi_deinit(0);
|
||||
#elif PLATFORM_BK7231T
|
||||
#elif PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
int err = 0;
|
||||
|
||||
uint8_t enable = 0;
|
||||
@ -121,7 +121,7 @@ int SPI_Deinit(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if PLATFORM_BK7231T
|
||||
#if PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
static inline int Spi_wait_for_ready() {
|
||||
uint8_t busy = 0;
|
||||
int err = 0;
|
||||
@ -135,9 +135,9 @@ static inline int Spi_wait_for_ready() {
|
||||
#endif
|
||||
|
||||
int SPI_WriteBytes(const void *data, uint32_t size) {
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
return bk_spi_write_bytes(0, data, size);
|
||||
#elif PLATFORM_BK7231T
|
||||
#elif PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
GLOBAL_INT_DECLARATION();
|
||||
GLOBAL_INT_DISABLE();
|
||||
|
||||
@ -166,9 +166,9 @@ int SPI_WriteBytes(const void *data, uint32_t size) {
|
||||
}
|
||||
|
||||
int SPI_ReadBytes(void *data, uint32_t size) {
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
return bk_spi_read_bytes(0, data, size);
|
||||
#elif PLATFORM_BK7231T
|
||||
#elif PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
GLOBAL_INT_DECLARATION();
|
||||
GLOBAL_INT_DISABLE();
|
||||
|
||||
@ -198,9 +198,9 @@ int SPI_ReadBytes(void *data, uint32_t size) {
|
||||
|
||||
int SPI_Transmit(const void *txData, uint32_t txSize, void *rxData,
|
||||
uint32_t rxSize) {
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
return bk_spi_transmit(0, txData, txSize, rxData, rxSize);
|
||||
#elif PLATFORM_BK7231T
|
||||
#elif PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
int err = 0;
|
||||
|
||||
if (txSize && txData)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
#include "arm_arch.h"
|
||||
|
||||
#include "drv_model_pub.h"
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
*/
|
||||
|
||||
#ifndef PLATFORM_XR809
|
||||
|
||||
#ifdef PLATFORM_BEKEN_NEW
|
||||
#endif
|
||||
#include "include.h"
|
||||
#include "mem_pub.h"
|
||||
#include "drv_model_pub.h"
|
||||
|
||||
@ -22,7 +22,7 @@ extern int MQTT_process_received();
|
||||
// from new_pins.c
|
||||
extern void PIN_ticks(void *param);
|
||||
|
||||
#if PLATFORM_BK7231T
|
||||
#if PLATFORM_BK7231T && !PLATFORM_BEKEN_NEW
|
||||
|
||||
// realloc fix - otherwise calling realloc crashes.
|
||||
// Just fall back to os_realloc.
|
||||
|
||||
@ -17,47 +17,47 @@
|
||||
|
||||
extern int g_pwmFrequency;
|
||||
|
||||
int PIN_GetPWMIndexForPinIndex(int pin) {
|
||||
if(pin == 6)
|
||||
return 0;
|
||||
if(pin == 7)
|
||||
return 1;
|
||||
if(pin == 8)
|
||||
return 2;
|
||||
if(pin == 9)
|
||||
return 3;
|
||||
if(pin == 24)
|
||||
return 4;
|
||||
if(pin == 26)
|
||||
return 5;
|
||||
return -1;
|
||||
int PIN_GetPWMIndexForPinIndex(int pin)
|
||||
{
|
||||
switch(pin)
|
||||
{
|
||||
case 6: return 0;
|
||||
case 7: return 1;
|
||||
case 8: return 2;
|
||||
case 9: return 3;
|
||||
case 24: return 4;
|
||||
case 26: return 5;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
const char *HAL_PIN_GetPinNameAlias(int index) {
|
||||
const char *HAL_PIN_GetPinNameAlias(int index)
|
||||
{
|
||||
// some of pins have special roles
|
||||
if (index == 23)
|
||||
return "ADC3";
|
||||
if (index == 26)
|
||||
return "PWM5";
|
||||
if (index == 24)
|
||||
return "PWM4";
|
||||
if (index == 6)
|
||||
return "PWM0";
|
||||
if (index == 7)
|
||||
return "PWM1";
|
||||
if (index == 0)
|
||||
return "TXD2";
|
||||
if (index == 1)
|
||||
return "RXD2";
|
||||
if (index == 9)
|
||||
return "PWM3";
|
||||
if (index == 8)
|
||||
return "PWM2";
|
||||
if (index == 10)
|
||||
return "RXD1";
|
||||
if (index == 11)
|
||||
return "TXD1";
|
||||
return "N/A";
|
||||
switch(index)
|
||||
{
|
||||
#ifndef PLATFORM_BK7238
|
||||
case 1: return "RXD2";
|
||||
case 10: return "RXD1";
|
||||
case 23: return "ADC3";
|
||||
case 24: return "PWM4";
|
||||
case 26: return "PWM5";
|
||||
#else
|
||||
case 1: return "RXD2/ADC5";
|
||||
case 10: return "RXD1/ADC6";
|
||||
case 26: return "PWM5/ADC1";
|
||||
case 24: return "PWM4/ADC2";
|
||||
case 20: return "ADC3";
|
||||
case 28: return "ADC4";
|
||||
#endif
|
||||
case 0: return "TXD2";
|
||||
case 11: return "TXD1";
|
||||
case 6: return "PWM0";
|
||||
case 7: return "PWM1";
|
||||
case 8: return "PWM2";
|
||||
case 9: return "PWM3";
|
||||
default: return "N/A";
|
||||
}
|
||||
}
|
||||
|
||||
int HAL_PIN_CanThisPinBePWM(int index) {
|
||||
@ -115,7 +115,7 @@ void HAL_PIN_PWM_Start(int index) {
|
||||
useFreq = PWM_FREQUENCY_SLOW;
|
||||
|
||||
uint32_t frequency = (26000000 / useFreq);
|
||||
#if PLATFORM_BK7231N
|
||||
#if defined(PLATFORM_BK7231N) && !defined(PLATFORM_BEKEN_NEW)
|
||||
// OSStatus bk_pwm_initialize(bk_pwm_t pwm, uint32_t frequency, uint32_t duty_cycle);
|
||||
bk_pwm_initialize(pwmIndex, frequency, 0, 0, 0);
|
||||
#else
|
||||
@ -140,7 +140,7 @@ void HAL_PIN_PWM_Update(int index, float value) {
|
||||
//uint32_t value_upscaled = value * 10.0f; //Duty cycle 0...100 -> 0...1000
|
||||
uint32_t period = (26000000 / g_pwmFrequency); //TODO: Move to global variable and set in init func so it does not have to be recalculated every time...
|
||||
uint32_t duty = (value / 100.0 * period); //No need to use upscaled variable
|
||||
#if PLATFORM_BK7231N
|
||||
#if defined(PLATFORM_BK7231N) && !defined(PLATFORM_BEKEN_NEW)
|
||||
bk_pwm_update_param(pwmIndex, period, duty,0,0);
|
||||
#else
|
||||
bk_pwm_update_param(pwmIndex, period, duty);
|
||||
|
||||
@ -10,6 +10,21 @@
|
||||
#include "../../beken378/app/config/param_config.h"
|
||||
#include "lwip/netdb.h"
|
||||
|
||||
#ifdef PLATFORM_BEKEN_NEW
|
||||
|
||||
#define SOFT_AP BK_SOFT_AP
|
||||
#define STATION BK_STATION
|
||||
#define SECURITY_TYPE_NONE BK_SECURITY_TYPE_NONE
|
||||
#define SECURITY_TYPE_WEP BK_SECURITY_TYPE_WEP
|
||||
#define SECURITY_TYPE_WPA_TKIP BK_SECURITY_TYPE_WPA_TKIP
|
||||
#define SECURITY_TYPE_WPA2_AES BK_SECURITY_TYPE_WPA2_AES
|
||||
#define SECURITY_TYPE_WPA2_MIXED BK_SECURITY_TYPE_WPA2_MIXED
|
||||
#define SECURITY_TYPE_AUTO BK_SECURITY_TYPE_AUTO
|
||||
|
||||
#define SOFT_AP BK_SOFT_AP
|
||||
|
||||
#endif
|
||||
|
||||
static void (*g_wifiStatusCallback)(int code);
|
||||
|
||||
// lenght of "192.168.103.103" is 15 but we also need a NULL terminating character
|
||||
@ -182,8 +197,10 @@ void wl_status(void* ctxt)
|
||||
|
||||
switch (stat) {
|
||||
case RW_EVT_STA_IDLE:
|
||||
#ifndef PLATFORM_BEKEN_NEW
|
||||
case RW_EVT_STA_SCANNING:
|
||||
case RW_EVT_STA_SCAN_OVER:
|
||||
#endif
|
||||
case RW_EVT_STA_CONNECTING:
|
||||
if (g_wifiStatusCallback != 0) {
|
||||
g_wifiStatusCallback(WIFI_STA_CONNECTING);
|
||||
|
||||
@ -14,7 +14,11 @@ typedef struct ENERGY_METERING_DATA {
|
||||
float YesterdayConsumption;
|
||||
long save_counter;
|
||||
float ConsumptionHistory[2];
|
||||
#ifdef PLATFORM_BEKEN_NEW
|
||||
unsigned int ConsumptionResetTime;
|
||||
#else
|
||||
time_t ConsumptionResetTime;
|
||||
#endif
|
||||
unsigned char reseved[3];
|
||||
char actual_mday;
|
||||
} ENERGY_METERING_DATA;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include "../new_common.h"
|
||||
#include "../driver/drv_uart.h"
|
||||
|
||||
#if PLATFORM_BK7231T | PLATFORM_BK7231N
|
||||
#if PLATFORM_BEKEN
|
||||
#define UART_2_UARTS_CONCURRENT
|
||||
#endif
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ extern uint32_t current_fw_idx;
|
||||
#include "temp_detect_pub.h"
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_BK7231T) || defined(PLATFORM_BK7231N)
|
||||
#if (defined(PLATFORM_BK7231T) || defined(PLATFORM_BK7231N)) && !defined(PLATFORM_BEKEN_NEW)
|
||||
int tuya_os_adapt_wifi_all_ap_scan(AP_IF_S** ap_ary, unsigned int* num);
|
||||
int tuya_os_adapt_wifi_release_ap(AP_IF_S* ap);
|
||||
#endif
|
||||
@ -1305,7 +1305,7 @@ int http_fn_cfg_wifi(http_request_t* request) {
|
||||
hprintf255(request, "[%i/%i] SSID: %s, Channel: %i, Signal %i<br>", (i+1), (int)ap_num, ap_info[i].ssid, ap_info[i].channel, ap_info[i].rssi);
|
||||
}
|
||||
vPortFree(ap_info);
|
||||
#elif PLATFORM_BK7231T
|
||||
#elif defined(PLATFORM_BK7231T) && !defined(PLATFORM_BEKEN_NEW)
|
||||
int i;
|
||||
|
||||
AP_IF_S* ar;
|
||||
@ -1318,7 +1318,7 @@ int http_fn_cfg_wifi(http_request_t* request) {
|
||||
hprintf255(request, "[%i/%i] SSID: %s, Channel: %i, Signal %i<br>", i, (int)num, ar[i].ssid, ar[i].channel, ar[i].rssi);
|
||||
}
|
||||
tuya_hal_wifi_release_ap(ar);
|
||||
#elif PLATFORM_BK7231N
|
||||
#elif defined(PLATFORM_BK7231N) && !defined(PLATFORM_BEKEN_NEW)
|
||||
int i;
|
||||
|
||||
AP_IF_S* ar;
|
||||
@ -1352,6 +1352,8 @@ int http_fn_cfg_wifi(http_request_t* request) {
|
||||
poststr(request, "TODO TR6260<br>");
|
||||
#elif defined(PLATFORM_REALTEK)
|
||||
poststr(request, "TODO Realtek<br>");
|
||||
#elif PLATFORM_BEKEN_NEW
|
||||
poststr(request, "TODO BEKEN_NEW<br>");
|
||||
#else
|
||||
#error "Unknown platform"
|
||||
poststr(request, "Unknown platform<br>");
|
||||
|
||||
@ -150,7 +150,8 @@ exit:
|
||||
if (reply != NULL)
|
||||
os_free(reply);
|
||||
|
||||
lwip_close(fd);;
|
||||
lwip_close(fd);
|
||||
|
||||
#if DISABLE_SEPARATE_THREAD_FOR_EACH_TCP_CLIENT
|
||||
|
||||
#else
|
||||
|
||||
@ -588,7 +588,7 @@ void setupAllWB2SPinsAsButtons() {
|
||||
// call with str == NULL to force send. - can be binary.
|
||||
// supply length
|
||||
int postany(http_request_t* request, const char* str, int len) {
|
||||
#if PLATFORM_BL602
|
||||
#if PLATFORM_BL602 || PLATFORM_BEKEN_NEW
|
||||
send(request->fd, str, len, 0);
|
||||
return 0;
|
||||
#else
|
||||
|
||||
@ -277,9 +277,7 @@ static int http_rest_post(http_request_t* request) {
|
||||
return http_rest_post_reboot(request);
|
||||
}
|
||||
if (!strcmp(request->url, "api/ota")) {
|
||||
#if PLATFORM_BK7231T
|
||||
return http_rest_post_flash(request, START_ADR_OF_BK_PARTITION_OTA, LFS_BLOCKS_END);
|
||||
#elif PLATFORM_BK7231N
|
||||
#if PLATFORM_BEKEN
|
||||
return http_rest_post_flash(request, START_ADR_OF_BK_PARTITION_OTA, LFS_BLOCKS_END);
|
||||
#elif PLATFORM_W600
|
||||
return http_rest_post_flash(request, -1, -1);
|
||||
|
||||
@ -8,6 +8,11 @@
|
||||
// Commands register, execution API and cmd tokenizer
|
||||
#include "../cmnds/cmd_public.h"
|
||||
|
||||
#if PLATFORM_BEKEN_NEW
|
||||
#include "uart.h"
|
||||
#include "arm_arch.h"
|
||||
#endif
|
||||
|
||||
extern uint8_t g_StartupDelayOver;
|
||||
|
||||
int g_loglevel = LOG_INFO; // default to info
|
||||
|
||||
@ -63,6 +63,11 @@ void OTA_RequestDownloadFromHTTP(const char *s);
|
||||
#define DEVICENAME_PREFIX_SHORT "obk"
|
||||
#define PLATFORM_MCU_NAME "BK7231T"
|
||||
#define MANUFACTURER "Beken Corporation"
|
||||
#elif PLATFORM_BK7238
|
||||
#define DEVICENAME_PREFIX_FULL "OpenBK7238"
|
||||
#define DEVICENAME_PREFIX_SHORT "obk"
|
||||
#define PLATFORM_MCU_NAME "BK7238"
|
||||
#define MANUFACTURER "Beken Corporation"
|
||||
#elif PLATFORM_BL602
|
||||
#define DEVICENAME_PREFIX_FULL "OpenBL602"
|
||||
#define DEVICENAME_PREFIX_SHORT "obl"
|
||||
@ -158,6 +163,10 @@ This platform is not supported, error!
|
||||
#define USER_SW_VER "RTL87X0C_Test"
|
||||
#elif defined(PLATFORM_RTL8710B)
|
||||
#define USER_SW_VER "RTL8710B_Test"
|
||||
#elif defined(PLATFORM_RTL8710A)
|
||||
#define USER_SW_VER "RTL8710A_Test"
|
||||
#elif defined(PLATFORM_BK7238)
|
||||
#define USER_SW_VER "BK7238_Test"
|
||||
#else
|
||||
#define USER_SW_VER "unknown"
|
||||
#endif
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
#include "esp_sleep.h"
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_BEKEN_NEW
|
||||
#include "manual_ps_pub.h"
|
||||
#endif
|
||||
|
||||
// According to your need to modify the constants.
|
||||
#define PIN_TMR_DURATION QUICK_TMR_DURATION // Delay (in ms) between button scan iterations
|
||||
@ -214,6 +217,22 @@ void PINS_BeginDeepSleepWithPinWakeUp(unsigned int wakeUpTime) {
|
||||
#ifdef PLATFORM_BK7231T
|
||||
extern void deep_sleep_wakeup_with_gpio(UINT32 gpio_index_map, UINT32 gpio_edge_map);
|
||||
deep_sleep_wakeup_with_gpio(g_gpio_index_map[0], g_gpio_edge_map[0]);
|
||||
#elif PLATFORM_BEKEN_NEW
|
||||
PS_DEEP_CTRL_PARAM params;
|
||||
params.gpio_index_map = g_gpio_index_map[0];
|
||||
params.gpio_edge_map = g_gpio_edge_map[0];
|
||||
params.sleep_mode = MANUAL_MODE_IDLE;
|
||||
if(wakeUpTime)
|
||||
{
|
||||
params.wake_up_way = PS_DEEP_WAKEUP_GPIO | PS_DEEP_WAKEUP_RTC;
|
||||
params.sleep_time = wakeUpTime;
|
||||
bk_enter_deep_sleep_mode(¶ms);
|
||||
}
|
||||
else
|
||||
{
|
||||
params.wake_up_way = PS_DEEP_WAKEUP_GPIO;
|
||||
bk_enter_deep_sleep_mode(¶ms);
|
||||
}
|
||||
#else
|
||||
extern void bk_enter_deep_sleep(UINT32 g_gpio_index_map, UINT32 g_gpio_edge_map);
|
||||
extern void deep_sleep_wakeup(const UINT32* g_gpio_index_map,
|
||||
|
||||
@ -172,7 +172,7 @@
|
||||
#define ENABLE_DRIVER_BL0942 1
|
||||
#define ENABLE_DRIVER_BL0942SPI 1
|
||||
#define ENABLE_DRIVER_CSE7766 1
|
||||
#define ENABLE_DRIVER_BMP280 1
|
||||
//#define ENABLE_DRIVER_BMP280 1
|
||||
//#define ENABLE_DRIVER_PT6523 1
|
||||
//#define ENABLE_DRIVER_MAX6675 1
|
||||
//#define ENABLE_DRIVER_TEXTSCROLLER 1
|
||||
@ -190,7 +190,7 @@
|
||||
#define ENABLE_DRIVER_HUE 1
|
||||
//#define ENABLE_DRIVER_CHARGINGLIMIT 1
|
||||
#define ENABLE_DRIVER_BATTERY 1
|
||||
#if PLATFORM_BK7231N
|
||||
#if PLATFORM_BK7231N && !PLATFORM_BEKEN_NEW
|
||||
//#define ENABLE_DRIVER_PWM_GROUP 1
|
||||
#define ENABLE_DRIVER_SM16703P 1
|
||||
#define ENABLE_DRIVER_PIXELANIM 1
|
||||
@ -215,6 +215,9 @@
|
||||
#define ENABLE_OBK_SCRIPTING 1
|
||||
//#define ENABLE_DRIVER_OPENWEATHERMAP 1
|
||||
#define OBK_OTA_EXTENSION ".rbl"
|
||||
#if PLATFORM_BEKEN_NEW
|
||||
#define NEW_TCP_SERVER 1
|
||||
#endif
|
||||
|
||||
// ENABLE_I2C_ is a syntax for
|
||||
// our I2C system defines for drv_i2c_main.c
|
||||
|
||||
@ -172,7 +172,7 @@ static int get_tsen_adc(
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_BK7231T
|
||||
#if PLATFORM_BK7231T || PLATFORM_BEKEN_NEW
|
||||
// this function waits for the extended app functions to finish starting.
|
||||
extern void extended_app_waiting_for_launch(void);
|
||||
void extended_app_waiting_for_launch2() {
|
||||
@ -1283,7 +1283,7 @@ void Main_Init_Before_Delay()
|
||||
// read or initialise the boot count flash area
|
||||
HAL_FlashVars_IncreaseBootCount();
|
||||
|
||||
#ifdef PLATFORM_BEKEN
|
||||
#if defined(PLATFORM_BEKEN) && !defined(PLATFORM_BEKEN_NEW)
|
||||
// this just increments our idle counter variable.
|
||||
// it registers a cllback from RTOS IDLE function.
|
||||
// why is it called IRDA?? is this where they check for IR?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user