这几天基本忙完一个通信板,利用晚上的时间搞了一下软件移植,基于这个版本“bitcraze-crazyflie-firmware-26d661941c7e.zip”。
发现问题还不少……
1-注释很少,该注释的地方基本没有(特别是算法部分,应该是作者发行时删掉了),不该注释的地方倒是一个不拉,特别是每个文件(即使是空文件)开头的那段 /**
* || ____ _ __
* +------+ / __ )(_) /_______________ _____ ___
* | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
* +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
* || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
*
* Crazyflie Firmware
*
* Copyright (C) 2011-2012 Bitcraze AB
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, in version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2-很多地方不知是没有实现,还是释放源码时阉割了……如低电源管理“PM.C”,“canFly”,config.h里的:
#define P_NAME "Crazyflie Rev.F"
#define H_INIT_EXTI
#define T_LAUNCH_ADC
#define T_LAUNCH_RADIO
#define T_LAUNCH_POWERMANAGMENT
#define T_LAUNCH_CONTROL
#define T_LAUNCH_MULTILOG_1
#define T_LAUNCH_MULTICONTROL
还有掉电参数存储“configblock.c”,参数只有很少的几个,上电后直接从127扇区读取,但搜索整个工程的代码,都没有任何Flash改写的代码,也就是根本没有修改参数的功能(或者是发行时阉割了?)
…………
3-从代码看来,没看出哪点能实现作者演示视频的那些功能……看起来像是前期的临时版本。不过作者能开源已经很好了,自己慢慢研究吧:lol |