- 博客(9)
- 收藏
- 关注
原创 字节颠倒补充
if ((InData & (1 OutData |= 0x80 >> (7-i);}效率很低,下面的会快很多unsigned char byte_reverse(unsigned char x){ unsigned char i,y; for(i=8; i; i--){ y if(x & 0x01){ y++;
2008-02-16 09:57:00
508
2
原创 字节颠倒用什么方法最好?
字节颠倒用什么方法最好?刚刚看到21ic上面侃单片机 中的讨论,有点意思。开始,以为在我看的书中讲过,后来一查,原来是关于little endian 和big endian的变化的:Programming Embedded Systems with C and GNU Development Tools, 2nd Edition (OReilly, 2006).chm6.3.2. E
2008-02-14 13:02:00
1024
原创 串口通讯程序(中断方式)
把我用的串口通讯程序(中断方式)搭个便车让大家看看,并非原创,从<<嵌入式系统构件>>的相关代码移植而来。#include "../inc/includes.h"char xdata ser_buffer[SERIAL_BUFF_SIZE]; /* the receive buffer*/int ser_end = -1;int ser_start=-1; /* indexes
2008-01-23 15:39:00
2955
原创 关于write-only register
关于write-only register的处理Programming Embedded Systems with C and GNU Development Tools7.1.1.7. Bitfields有以下叙述Unique RegistersSome registers (or bits within a register) can be read-only or write
2008-01-23 15:34:00
815
原创 比较隐秘的中断所带来的危害
参考帖子:http://bbs.21ic.com/club/bbs/bbsView.asp?action=topicwithme程序的源代码是:#include #include unsigned int count;unsigned long sum;unsigned long error;unsigned char flag;#pragma vector = TIMER1_COMP
2008-01-23 13:29:00
540
5
原创 关于结构体struct的讨论
在帖子http://bbs.21ic.com/club/bbs/bbsView.asp?action=topicwithme上,提出以下代码不能用:struct { unsigned unused:2; unsigned Key5: 1; unsigned Key6: 1; unsigned Key4: 1; unsigned Key3:
2008-01-23 13:05:00
706
原创 打好基础,很重要
在21IC上面看到一个关于基础讨论的帖子:把老谭的书每个角落都仔细看7-8遍,例子做三遍,《C++高质量编程》,有关C的部分看个3-5遍,搞懂每个细节。《嵌入式程序员的0x10个问题》,看个3-5遍,搞懂每个细节。 顺着第三项,想找到他的原版,作者是Nigel Jones,花了一些工夫,得到:The 0x10 Best Questions for Would-be Embedded Pro
2008-01-23 12:51:00
988
原创 读书终于完成2
其中的关于RAM测试的话题,仍然可以深入的,现在在看Testing RAM in Embedded Systems Jack G.Ganssle到时候应当有个总结吧!还有关于操作系统的一章 chapter 10,其中介绍了好多functionality ,比如Even flags/condition variables/spin clocks自旋锁 等等,结合uCOSII,应当有个
2008-01-22 16:59:00
270
原创 Programming Embedded Systems with C and GNU Development Tools, 2nd Edition (OReilly, 2006)的读书终于完成
大概持续了3个星期左右吧,其实都是上班的时候看的,不过比以前认真的多,研究的比较仔细一些,看了两遍,虽然是英文的,还好我对付的来,也都懂得.记录下来的一些单词,还没有查.这个周末,应当能够安排一些时间来搞定这些单词,还有再快速的看一遍,复习一下重点.到时候可以来修改这偏文章,加点东西吧对一般的嵌入式了解了,才觉得这些东西并不是最重要的:最重要的是具体的芯片上具体的开发.就象书中9.1中讲的
2008-01-22 16:53:00
529
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人