AS1_TComData

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

AS1_TComData

跳至解决方案
1,991 次查看
tmyint
Contributor I
hi,

this is HC08 CW v5.0.
the sending and receiving function code that ESCI and SPI beans generate,
AS1_SendChar(AS1_TComData Chr)
why is the datatype defined/called AS1_TcomData ? Why can't it just be called byte or char?
I found the typedef declaration somewhere in one of the files in the project.
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
940 次查看
CompilerGuru
NXP Employee
NXP Employee
The typedef does make sense, when you use an SCI in 9 bit mode, then AS1_TComData is typedefed to word, not to byte anymore.
So with the typedef the code works independently of this setting.
If you want to use byte in your code, well that's actually even compatible as in C typedefs do not introduce new types, they just introduce an alias to an existing type. Of course then your code will fail with a 9 bit SCI.

Daniel

在原帖中查看解决方案

0 项奖励
回复
1 回复
941 次查看
CompilerGuru
NXP Employee
NXP Employee
The typedef does make sense, when you use an SCI in 9 bit mode, then AS1_TComData is typedefed to word, not to byte anymore.
So with the typedef the code works independently of this setting.
If you want to use byte in your code, well that's actually even compatible as in C typedefs do not introduce new types, they just introduce an alias to an existing type. Of course then your code will fail with a 9 bit SCI.

Daniel
0 项奖励
回复