C 语言嵌入式系统编程修炼之道
C 语言嵌入式系统编程
修炼之道
整理 Cysoft /摘自 Internet
1
C 语言嵌入式系统编程修炼之道
目录
1.背景......................................................................................... 3
2. 软件架构篇........................................................................... 5
2.1 模块划分............................................................................................................................5 2.2 多任务还是单任务............................................................................................................6 2.3 单任务程序典型架构........................................................................................................6 2.4 中断服务程序....................................................................................................................7
2.5 硬件驱动模块....................................................................................................................9
2.6 C 的面向对象化.................................................................................................................9 2.7 总结..................................................................................................................................10
3 内存操作.............................................................................. 10
3.1 数据指针..........................................................................................................................10 3.2 函数指针..........................................................................................................................11 3.3 数组 vs.动态申请 ............................................................................................................11 3.4 关键字 const ....................................................................................................................12 3.5 关键字 volatile.................................................................................................................13 3.6 CPU 字长与存储器位宽不一致处理...................................................................