Browse Source

update

master
zhaohe 2 years ago
parent
commit
d308aa6ebd
  1. 2
      sdk
  2. 21
      usrc/main.cpp
  3. 6
      usrc/project_configs.h

2
sdk

@ -1 +1 @@
Subproject commit 40d6da40267dc39bcff6b282dd6ed6e7da4408df
Subproject commit 61021e00a94a56c52f49a82ca5bbedf3f17349d1

21
usrc/main.cpp

@ -36,6 +36,8 @@ static ZCanStepMotorCtrlModule zcanStepMotorCtrlModule;
static XYRobotCtrlModule xyRobotCtrlModule;
static ZCANXYRobotCtrlModule zcanXYRobotCtrlModule;
#define XYRobotCtrlModule_1_FLASH_MARK "XYRobotCtrlModule_1"
void umain() {
chip_cfg_t chipcfg;
chipcfg.us_dleay_tim = &DELAY_US_TIMER;
@ -48,12 +50,18 @@ void umain() {
zos_cfg_t zoscfg;
zos_init(&zoscfg);
/*******************************************************************************
* NVSINIT *
*******************************************************************************/
ZNVS::ins().initialize();
// ZNVS::ins().set_config_int32("test", 1234);
ZNVS::ins().dumpcfg();
{
static I_XYRobotCtrlModule::flash_config_t cfg;
XYRobotCtrlModule::create_default_cfg(cfg);
ZNVS::ins().alloc_config(XYRobotCtrlModule_1_FLASH_MARK, (uint8_t*)&cfg, sizeof(cfg));
}
ZNVS::ins().init_config();
osDelay(1000);
{
TMC4361A::cfg_t cfg = {
.spi = &TMC_MOTOR_SPI, //
@ -126,11 +134,8 @@ void umain() {
input[6].initAsInput(ARM_SENSOR7_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
input[7].initAsInput(ARM_SENSOR8_GPIO, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false);
xyRobotCtrlModule.initialize(&motora, &motorb, &input[6], &input[7]);
I_XYRobotCtrlModule::base_param_t base_param;
xyRobotCtrlModule.create_default_cfg(base_param);
xyRobotCtrlModule.set_base_param(base_param);
xyRobotCtrlModule.initialize(&motora, &motorb, &input[6], &input[7], XYRobotCtrlModule_1_FLASH_MARK);
xyRobotCtrlModule.dumpcfg();
zcanXYRobotCtrlModule.initialize(&zcanCmder, 1, &xyRobotCtrlModule);
while (true) {

6
usrc/project_configs.h

@ -1,5 +1,6 @@
#pragma once
#define VERSION "v1.0.0"
#define MANUFACTURER "http://www.iflytop.com/"
#define PROJECT_NAME "filarobot_arm"
@ -13,12 +14,11 @@
#define IFLYTOP_ENABLE_OS 1
#define IFLYTOP_PREEMPTPRIORITY_DEFAULT 5
#define IFLYTOP_NVS_CONFIG_MAX_ITEM_NUM 100
#define IFLYTOP_NVS_CONFIG_FLASH_SECTOR 8
#define DEVICE_ID (2)
/****************************************FLASH***************************************/
#define IFLYTOP_NVS_CONFIG_FLASH_SECTOR 8
/*********************************************************************************/
// MOTOR1

Loading…
Cancel
Save