diff --git a/README.md b/README.md index 0ea5d38..2a8c11a 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,13 @@ 关键文件: + +``` + +``` +ID地址: +0x080E0000 + ``` @@ -43,6 +50,8 @@ PE2 调试指示灯 + + diff --git a/usrc/main.cpp b/usrc/main.cpp index 948f850..d7ce88a 100644 --- a/usrc/main.cpp +++ b/usrc/main.cpp @@ -6,9 +6,11 @@ #include "configs/device_id_mgr.hpp" #include "sdk/chip/chip.hpp" #include "sdk/os/zos.hpp" +#include "subboards/subboard30_shake_module/subboard30_shake_module.hpp" #define TAG "main" using namespace std; +using namespace iflytop; extern void umain(); extern "C" { @@ -36,8 +38,14 @@ void umain() { ZEARLY_LOGI("SYS", "= build time : %s", __DATE__ " " __TIME__); ZEARLY_LOGI("SYS", "= device id : %d", id); - - ZLOGI(TAG, "zaf_flash_flush ok"); + if (id <= 0) { + chip_set_error(); + ZEARLY_LOGE("SYS", "device id is not set"); + } else { + if (id == 30) { + Subboard30ShakeModule::ins()->initializeAndRun(); + } + } while (true) { zos_delay(1); diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 0901e96..c69e6b2 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -39,4 +39,4 @@ * 11 0x080E0000 128k */ #define SN_FLASH_ADD 0x080E0000 // 使用扇区11存储SN编码 -#define SN_FLASH_EARSE_SECTOR FLASH_SECTOR_7 \ No newline at end of file +#define SN_FLASH_EARSE_SECTOR FLASH_SECTOR_11 \ No newline at end of file diff --git a/usrc/subboards/subboard30_shake_module/subboard30_shake_module.cpp b/usrc/subboards/subboard30_shake_module/subboard30_shake_module.cpp new file mode 100644 index 0000000..9cecb9f --- /dev/null +++ b/usrc/subboards/subboard30_shake_module/subboard30_shake_module.cpp @@ -0,0 +1,13 @@ +#include "subboard30_shake_module.hpp" + +using namespace iflytop; + +Subboard30ShakeModule::Subboard30ShakeModule(/* args */) {} +Subboard30ShakeModule::~Subboard30ShakeModule() {} + +void Subboard30ShakeModule::initializeAndRun() {} + +Subboard30ShakeModule* Subboard30ShakeModule::ins() { + static Subboard30ShakeModule instance; + return &instance; +} diff --git a/usrc/subboards/subboard30_shake_module/subboard30_shake_module.hpp b/usrc/subboards/subboard30_shake_module/subboard30_shake_module.hpp new file mode 100644 index 0000000..3582841 --- /dev/null +++ b/usrc/subboards/subboard30_shake_module/subboard30_shake_module.hpp @@ -0,0 +1,23 @@ +#include +#include + +#include "board.h" +// +#include "configs/device_id_mgr.hpp" +#include "sdk/chip/chip.hpp" +#include "sdk/os/zos.hpp" + +namespace iflytop { +class Subboard30ShakeModule { + private: + /* data */ + public: + Subboard30ShakeModule(/* args */); + ~Subboard30ShakeModule(); + + static Subboard30ShakeModule* ins(); + + void initializeAndRun(); +}; + +} // namespace iflytop diff --git a/usrc/subboards/subboards.hpp b/usrc/subboards/subboards.hpp new file mode 100644 index 0000000..075cf7e --- /dev/null +++ b/usrc/subboards/subboards.hpp @@ -0,0 +1,3 @@ +#pragma once + +#include "subboard30_shake_module/subboard30_shake_module.hpp" \ No newline at end of file