当前位置: 首页 > news >正文

站长收录平台网站内容搜索

站长收录平台,网站内容搜索,邯郸做小程序公司,国外一直小猫做图标的网站pico高级API函数中, multicore_fifo_pop_timeout_us 和 multicore_fifo_push_timeout_us 的延时参数, 如修改为500微秒以上时,其延时似乎远远超过设定值,其反馈速度似乎被主核的交互所左右 ,而修改为200以下时&#x…

pico高级API函数中,
multicore_fifo_pop_timeout_us 和  multicore_fifo_push_timeout_us 的延时参数,
如修改为500微秒以上时,其延时似乎远远超过设定值,其反馈速度似乎被主核的交互所左右 ,而修改为200以下时,反馈出现阶越:运行这两个函数 的core1的打印速度快速增加,显示其延时更加与设定值相符。

测试的代码:

#include <stdio.h>
#include "pico/stdlib.h"#include "pico/multicore.h"
#define FLAG_VALUE 2void core1_entry() {uint32_t g=0;
bool ifthereisp=false;
uint64_t timeout_u=500;   //这儿修改为500微秒以上时,core1的打印速度和core0 1hz基本同步 ,而修改为200以下时,反馈出现阶越:core1的打印速度快速增加。
uint32_t out;lable2:multicore_fifo_push_timeout_us ( FLAG_VALUE,timeout_u) ;if( !multicore_fifo_pop_timeout_us (timeout_u,&out) )printf("Hmm, that's not right on core 1!\n");elseprintf("Its all gone well on core 1! %u  \n",out);
goto lable2;while (1)tight_loop_contents();
}int main() {stdio_init_all();sleep_ms(1000);
printf("Hello, fakeone\n");sleep_ms(1000);multicore_launch_core1(core1_entry);uint32_t g=0;// Wait for it to start up
lable:g = multicore_fifo_pop_blocking();if (g != FLAG_VALUE)printf("Hmm, that's not right on core 0!\n");else {multicore_fifo_push_blocking(FLAG_VALUE);printf("It's all gone well on core 0!\n");}
sleep_ms(1000);
goto lable;while (true) {printf("Hello, world!\n");sleep_ms(1000);}return 0;
}

关键函数介绍官方原文:

bool multicore_fifo_pop_timeout_us     (     uint64_t      timeout_us,
        uint32_t *      out
    )         

Pop data from the read FIFO (data from the other core) with timeout.

This function will block until there is data ready to be read or the timeout is reached

See the note in the fifo section for considerations regarding use of the inter-core FIFOs
Parameters

timeout_us     the timeout in microseconds
out     the location to store the popped data if available
Returns

true if the data was popped and a value copied into out, false if the timeout occurred before data could be popped


bool multicore_fifo_push_timeout_us     (     uint32_t      data,
        uint64_t      timeout_us
    )         

Push data on to the write FIFO (data to the other core) with timeout.

This function will block until there is space for the data to be sent or the timeout is reached
Parameters

data     A 32 bit value to push on to the FIFO
timeout_us     the timeout in microseconds
Returns

true if the data was pushed, false if the timeout occurred before data could be pushed

附pico例程原代码:


#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/multicore.h"#define FLAG_VALUE 123void core1_entry() {multicore_fifo_push_blocking(FLAG_VALUE);uint32_t g = multicore_fifo_pop_blocking();if (g != FLAG_VALUE)printf("Hmm, that's not right on core 1!\n");elseprintf("Its all gone well on core 1!");while (1)tight_loop_contents();
}int main() {stdio_init_all();printf("Hello, multicore!\n");multicore_launch_core1(core1_entry);// Wait for it to start upuint32_t g = multicore_fifo_pop_blocking();if (g != FLAG_VALUE)printf("Hmm, that's not right on core 0!\n");else {multicore_fifo_push_blocking(FLAG_VALUE);printf("It's all gone well on core 0!");}}

http://www.yayakq.cn/news/787262/

相关文章:

  • 唐山网站建设500元中文wordpress视频主题
  • 北京个人网站公司wordpress 多说
  • 做网站水晶头百度地图下载2022新版安装
  • 网站建设技术支持有什么煤炭建设行业协会网站
  • 公司网站管理制度现在网站建设用什么语言
  • 做化工的在哪个网站做平台好做影视网站用什么网盘最好
  • 东莞设计企业网站的有哪些wordpress图片自动居中
  • 乾安网站建设腾讯云建设网站教程
  • 网站建设费怎么做会计分录外贸平台
  • 国展网站建设深圳市房地产信息网查询系统
  • 地方网站域名网页制作模板主题
  • 嘉兴网站制作价格word做网站连接
  • 萝岗网站开发asp源码 自助建站
  • 婚庆网站建设策划案费用预算辽宁建设工程信息网怎么查人员
  • 国内优秀的网站设计网站原型图设计
  • 做网站的联系方式专门做酒店的网站
  • 附近哪里有计算机培训班兰州官网优化技术厂家
  • 手机网站跳出率低目前最牛的二级分销模式
  • 怎样做旅游视频网站用邮箱做网站
  • 广东微信网站制作哪家好wordpress 评论 样式
  • 口碑好的南京网站建设在线设计平台行业环境
  • 建设职业学校精品网站p2p网站建设公司
  • 音乐网站制作源代码云南高端网站建设
  • 天津网站设计公司网站开发实训步骤
  • 管理外贸网站模板seo中国是什么
  • 设计本官方网站案例全国企业公示信息公示网官网
  • 公司做环评的网站娄底市网站建设制作
  • 做网站都需要准备什么企业门户网站设计建设与维护
  • 怎么做ppt教程网站常州免费企业网站建设
  • 制定网站分工任务网站的建设规划网站建设有哪些关键细节