Hallo zusammen Ich habe eine Union:
1 | typedef union |
2 | {
|
3 | struct
|
4 | {
|
5 | uint8_t NLOAD : 1; |
6 | uint8_t FNLOAD : 1; |
7 | uint8_t VANLOAD : 1; |
8 | }
|
9 | uint8_t status |
10 | }reg02; |
Nun möchte ich die variable tmp als diese union interpretieren.
1 | uint8_t tmp |
2 | ....
|
3 | ((reg02)tmp).NLOAD = 1; |
Weshalb geht das so nicht? Danke!