AS1_TComData

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AS1_TComData

Jump to solution
1,430 Views
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.
Labels (1)
Tags (1)
0 Kudos
1 Solution
379 Views
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

View solution in original post

0 Kudos
1 Reply
380 Views
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 Kudos