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

温州网站优化案例涟水县建设局网站

温州网站优化案例,涟水县建设局网站,文章时间分类wordpress,做英文网站挂谷歌广告前言 前几篇已经 通过 STM32CubeMX 搭建了 NUCLEO-L476RG 的 STM32L476RG 的 裸机工程#xff0c;下载了 uC-OS2 V2.93 的源码#xff0c;并把 uC-OS2 的源文件加入 Keil MDK5 工程#xff0c;通过适配 Systick 系统定时器与 PendSV 实现任务调度#xff0c;初步让 uC-OS2 …前言 前几篇已经 通过 STM32CubeMX 搭建了 NUCLEO-L476RG 的 STM32L476RG 的 裸机工程下载了 uC-OS2 V2.93 的源码并把 uC-OS2 的源文件加入 Keil MDK5 工程通过适配 Systick 系统定时器与 PendSV 实现任务调度初步让 uC-OS2 运行起来 本篇适配 uC-OS2 的 串口驱动实现 类似于 printf 的打印功能让 uC-OS2 有串口运行信息 开发环境 win10 64位 Keil uVision5MDK V5.36 uC-OS2 V2.93 开发板NUCLEO-L476RG MCU 为 STM32L476RG STM32CubeMX 6.9.1用于生成 STM32的裸机工程 串口驱动 通过 STM32CubeMX已经配置了串口的驱动默认串口的波特率是 115200 bps不过没有串口输出的接口需要自己完善一下 新建 uart.c驱动如下 #include uart2.h #include stdio.h #include stdarg.h #include string.h #include stm32l4xx_hal.hstatic UART_HandleTypeDef huart2;#define DBG_BUFF_MAX_LEN 256 static char rt_log_buf[DBG_BUFF_MAX_LEN] { 0 };void uart2_put(const char *fmt) {HAL_UART_Transmit(huart2, (uint8_t *)fmt, strlen(fmt), 0xFFFF); }/* debug print */ int os_printf(const char *fmt, ...) {int length;va_list args;va_start(args, fmt);length vsnprintf(rt_log_buf, sizeof(rt_log_buf) - 1, fmt, args);uart2_put(rt_log_buf);return length; }int uart2_init(uint32_t baud_rate) {huart2.Instance USART2;huart2.Init.BaudRate baud_rate;huart2.Init.WordLength UART_WORDLENGTH_8B;huart2.Init.StopBits UART_STOPBITS_1;huart2.Init.Parity UART_PARITY_NONE;huart2.Init.Mode UART_MODE_TX_RX;huart2.Init.HwFlowCtl UART_HWCONTROL_NONE;huart2.Init.OverSampling UART_OVERSAMPLING_16;huart2.Init.OneBitSampling UART_ONE_BIT_SAMPLE_DISABLE;huart2.AdvancedInit.AdvFeatureInit UART_ADVFEATURE_NO_INIT;return HAL_UART_Init(huart2); }说明 这里通过 C 标准库 vsnprintf 实现格式化打印定义一个 全局的 buffer。 新建 uart2.h 头文件 #ifndef __UART2_H__ #define __UART2_H__#include stdint.hint uart2_init(uint32_t baud_rate); int os_printf(const char *fmt, ...);#endifmain 函数调用 首先包含 #include uart2.h然后 初始化串口uart2_init(UART2_BAUD_RATE);然后就可以使用 os_printf 格式化打印了 格式化打印的意思就是可以像 printf 那样把一个数值 打印输出 十进制、十六进制等工程也可以 %s 输出一个字符串 修改后的 main.c 如下 #include main.h #include led.h #include app_cfg.h #include os.h #include uart2.hvoid SystemClock_Config(void); static void MX_GPIO_Init(void);#define UART2_BAUD_RATE 115200 #define MCU_FREQUENCY 80000000#define TASK_LED_PRIO 5 #define TASK_LED_STACK_SIZE 128 static OS_STK task_led_stack[TASK_LED_STACK_SIZE];static void task_led_entry(void *p_arg) {int cnt 0;while (1){led_grn_ctrl(1);OSTimeDly(1000);led_grn_ctrl(0);OSTimeDly(1000);cnt;os_printf(%s : cnt : %d\r\n, __func__, cnt);} }void led_task_init(void) {OSTaskCreate(task_led_entry,(void *)0, task_led_stack[TASK_LED_STACK_SIZE-1], TASK_LED_PRIO); }HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {return HAL_OK; }/*** brief The application entry point.* retval int*/ int main(void) {HAL_Init();SystemClock_Config();MX_GPIO_Init();uart2_init(UART2_BAUD_RATE);os_printf(%s : uC-OS2 Starting...\r\n, __func__);OSInit();led_task_init();OS_CPU_SysTickInitFreq(MCU_FREQUENCY);OSStart();return 0; }串口信息 编译、烧写到开发板查看 串口的信息当前配置的串口波特率是 115200 bps 当前串口打印信息正常 小结 本篇主要在 uC-OS2 上实现 类似于 printf 的串口格式化打印输出功能适配串口驱动 接下来继续研究 uC-OS2 上实现串口的 shell 等功能不断的深入熟悉 uC-OS2 的各个模块
文章转载自:
http://www.morning.hjjkz.cn.gov.cn.hjjkz.cn
http://www.morning.taipinghl.cn.gov.cn.taipinghl.cn
http://www.morning.qllcm.cn.gov.cn.qllcm.cn
http://www.morning.szoptic.com.gov.cn.szoptic.com
http://www.morning.8yitong.com.gov.cn.8yitong.com
http://www.morning.krlsz.cn.gov.cn.krlsz.cn
http://www.morning.sooong.com.gov.cn.sooong.com
http://www.morning.tnzwm.cn.gov.cn.tnzwm.cn
http://www.morning.wbnsf.cn.gov.cn.wbnsf.cn
http://www.morning.dbrnl.cn.gov.cn.dbrnl.cn
http://www.morning.mbhdl.cn.gov.cn.mbhdl.cn
http://www.morning.gskzy.cn.gov.cn.gskzy.cn
http://www.morning.kxqmh.cn.gov.cn.kxqmh.cn
http://www.morning.dqkrf.cn.gov.cn.dqkrf.cn
http://www.morning.ccyns.cn.gov.cn.ccyns.cn
http://www.morning.pakistantractors.com.gov.cn.pakistantractors.com
http://www.morning.lbxcc.cn.gov.cn.lbxcc.cn
http://www.morning.zwndt.cn.gov.cn.zwndt.cn
http://www.morning.rzmlc.cn.gov.cn.rzmlc.cn
http://www.morning.ldzxf.cn.gov.cn.ldzxf.cn
http://www.morning.kggxj.cn.gov.cn.kggxj.cn
http://www.morning.kgfsz.cn.gov.cn.kgfsz.cn
http://www.morning.lmtbl.cn.gov.cn.lmtbl.cn
http://www.morning.tsnwf.cn.gov.cn.tsnwf.cn
http://www.morning.bfybb.cn.gov.cn.bfybb.cn
http://www.morning.lxkhx.cn.gov.cn.lxkhx.cn
http://www.morning.dljujia.com.gov.cn.dljujia.com
http://www.morning.bqmhm.cn.gov.cn.bqmhm.cn
http://www.morning.wbfly.cn.gov.cn.wbfly.cn
http://www.morning.kndt.cn.gov.cn.kndt.cn
http://www.morning.xhddb.cn.gov.cn.xhddb.cn
http://www.morning.bpmnq.cn.gov.cn.bpmnq.cn
http://www.morning.smdnl.cn.gov.cn.smdnl.cn
http://www.morning.skbkq.cn.gov.cn.skbkq.cn
http://www.morning.gyjld.cn.gov.cn.gyjld.cn
http://www.morning.gbwfx.cn.gov.cn.gbwfx.cn
http://www.morning.yxwnn.cn.gov.cn.yxwnn.cn
http://www.morning.wtnyg.cn.gov.cn.wtnyg.cn
http://www.morning.mcjrf.cn.gov.cn.mcjrf.cn
http://www.morning.jghty.cn.gov.cn.jghty.cn
http://www.morning.qzpsk.cn.gov.cn.qzpsk.cn
http://www.morning.fnnkl.cn.gov.cn.fnnkl.cn
http://www.morning.zkqjz.cn.gov.cn.zkqjz.cn
http://www.morning.dtpqw.cn.gov.cn.dtpqw.cn
http://www.morning.kycwt.cn.gov.cn.kycwt.cn
http://www.morning.qwqzk.cn.gov.cn.qwqzk.cn
http://www.morning.mnpdy.cn.gov.cn.mnpdy.cn
http://www.morning.kwnbd.cn.gov.cn.kwnbd.cn
http://www.morning.zljqb.cn.gov.cn.zljqb.cn
http://www.morning.zybdj.cn.gov.cn.zybdj.cn
http://www.morning.dmzzt.cn.gov.cn.dmzzt.cn
http://www.morning.mmhyx.cn.gov.cn.mmhyx.cn
http://www.morning.rltsx.cn.gov.cn.rltsx.cn
http://www.morning.mlfmj.cn.gov.cn.mlfmj.cn
http://www.morning.bfjyp.cn.gov.cn.bfjyp.cn
http://www.morning.rkrl.cn.gov.cn.rkrl.cn
http://www.morning.wjplr.cn.gov.cn.wjplr.cn
http://www.morning.kmkpm.cn.gov.cn.kmkpm.cn
http://www.morning.jrpmf.cn.gov.cn.jrpmf.cn
http://www.morning.qrndh.cn.gov.cn.qrndh.cn
http://www.morning.xblrq.cn.gov.cn.xblrq.cn
http://www.morning.rhsr.cn.gov.cn.rhsr.cn
http://www.morning.fnfhs.cn.gov.cn.fnfhs.cn
http://www.morning.ktfbl.cn.gov.cn.ktfbl.cn
http://www.morning.lrflh.cn.gov.cn.lrflh.cn
http://www.morning.rntby.cn.gov.cn.rntby.cn
http://www.morning.nnpfz.cn.gov.cn.nnpfz.cn
http://www.morning.xrksf.cn.gov.cn.xrksf.cn
http://www.morning.mbnhr.cn.gov.cn.mbnhr.cn
http://www.morning.phgz.cn.gov.cn.phgz.cn
http://www.morning.bsplf.cn.gov.cn.bsplf.cn
http://www.morning.drtgt.cn.gov.cn.drtgt.cn
http://www.morning.rknsp.cn.gov.cn.rknsp.cn
http://www.morning.snbrs.cn.gov.cn.snbrs.cn
http://www.morning.rhqr.cn.gov.cn.rhqr.cn
http://www.morning.jrsgs.cn.gov.cn.jrsgs.cn
http://www.morning.clpfd.cn.gov.cn.clpfd.cn
http://www.morning.prhqn.cn.gov.cn.prhqn.cn
http://www.morning.qtrlh.cn.gov.cn.qtrlh.cn
http://www.morning.gstg.cn.gov.cn.gstg.cn
http://www.tj-hxxt.cn/news/278491.html

相关文章:

  • 大连网站推广公司wordpress搭建知识库
  • 网站地图有什么作用做俄罗斯外贸网站推广
  • 网站底部悬浮导航襄阳seo公司
  • 做视频的音乐哪里下载网站上海有哪些大公司
  • 站内推广方案网站添加百度地图导航
  • 网页设计 网站可以挣钱的设计网站
  • 企业微信网站开发文档东营网站建设天锐科技
  • 网站建设服务器的选择方案新乡集团网站建设
  • 宁波做网站有哪些公司公司电子商务网站建设市场
  • 青岛网站建设服务平台h5做招聘网站
  • 网站运营怎么样做网站该读啥学校
  • 网站销售怎么做广州网站备案
  • 中山手机网站建设费用广告公司怎么做业务
  • python做网站前端网站定位方案
  • 住房和城市建设部网站网络运营推广
  • 爱站网能不能挖掘关键词营销方案模板
  • 酒店 公司 安徽 网站建设网站功能模块 分析
  • 摄影师都在哪些网站发布作品赤峰网站设计公司
  • 如何做照片ppt模板下载网站做任务的正规网站
  • 海口企业建站系统模板沈阳网站建设报价
  • 网站建设企业谁家好asp网站建设项目实训
  • 温州专业营销网站建设wordpress 幻灯片代码在哪
  • 惠州网站建设html5网站备案协议书
  • 各大网站收录提交入口上海缘震网络科技有限公司
  • 网站备案服务商查询已备案域名购买网址低价
  • 想做网站怎么跟做网站的公司谈判产品logo设计
  • 家装设计网站排行榜前十名网站关键词设置
  • 建站宝盒小程序网站建设实训记录
  • 怎样做简易局域网站点怎么建php网站
  • 典型的企业网站青岛网站建设公司大全