支持使用{组名.变量名}访问变量:if you would like to set the effect variable in the ring group it's accessed using ring.effect.
可以在任意时刻访问和修改变量 The reading or writing of a parameter can be done at any time once you are connected to the Crazyflie.
读写没有线程安全保护:There's no thread protection on reading/writing. Since the architecture is 32bit and the largest parameter you can have is 32bit it's safe to write one variable. But if you write a group of variables that should be used together (like PID parameters) you might end up in trouble.
在访问运行期变化的变量时,推荐使用LOG_GROUP:Only use the parameter framework to read variables that are set during start-up. If variables change during runtime then use the logging framework.
\\示例:
.iram0.text :
{
/* Code marked as runnning out of IRAM */
_iram_text_start = ABSOLUTE(.);
/* Placement rules generated from the processed fragments, placed where the marker was in the template */
*(.iram1 .iram1.*)
*libfreertos.a:(.literal .text .literal.* .text.*)
_iram_text_end = ABSOLUTE(.);
} > iram0_0_seg
switch (params[id].type & PARAM_BYTES_MASK)
{
case PARAM_1BYTE:
*(uint8_t*)params[id].address = *(uint8_t*)valptr;
break;
case PARAM_2BYTES:
*(uint16_t*)params[id].address = *(uint16_t*)valptr;
break;
case PARAM_4BYTES:
*(uint32_t*)params[id].address = *(uint32_t*)valptr;
break;
case PARAM_8BYTES:
*(uint64_t*)params[id].address = *(uint64_t*)valptr;
break;
}
三、 LOG_GROUP
把变量加入LOG_GROUP,可以从上位机监控变量的变化:The logging framework is used to log variables from the Crazyflie at a specific interval.
上位机下载TOC并完成设置,将收到Crazyflie主动push的数据:Instead of triggering a reading of the variables at certain intervals, the framework is used to set up a logging configuration to that will push data from the Crazyflie to the host.
The interval for a logging configuration is specified in 10th of milliseconds.