Hallo zusammen,
ich habe bei ST für die STM8 Mikrocontroller einen LIN Stack gefunden,
den ich für meinen Xmega portieren möchte.
Ich dachte "ganz leicht". Mach ich am Wochenende. Hmm, naja. Ich steh
auf dem Schlauch.
1 | /*********************************************************************
|
2 | *
|
3 | * The LIN driver expects a real stack memory model for all functions
|
4 | * If a memory model is used that implements a non standard behavior
|
5 | * for function calls, adjust the STACK macro to the token that
|
6 | * must be written before each function to guarantee use of real
|
7 | * stack for that function
|
8 | * For the COSMIC compiler this is @stack
|
9 | *
|
10 | *********************************************************************/
|
11 | #ifdef __COSMIC__
|
12 | #define STACK @stack
|
13 | #elif __RAISONANCE__
|
14 | #define STACK
|
15 | #elif __IAR__
|
16 | #define STACK
|
17 | #else
|
18 | #error "This LIN driver is developed for the COSMIC, RAISONANCE and IAR compilers only"
|
19 | #endif
|
Das steht in dem einen File. Hier muss was angepasst werden, je nachdem
welchen Compiler man verwendet. Damit hatte ich noch nie zu tun. Was
bedeutet dies nun, wenn ich den xmega verwenden will? Muss ich da was
machen.
Hier die Stelle auf die es sich bezieht:
1 | /* structure to hold the ifc control function pointers */
|
2 | typedef struct ifc_ctrl_hooks
|
3 | {
|
4 | STACK bool (*initHook) (void);
|
5 | STACK bool (*connectHook) (void);
|
6 | STACK bool (*disconnectHook) (void);
|
7 | STACK void (*txCharHook) (uint8_t);
|
8 | STACK void (*rxFunc) (void);
|
9 | STACK void (*txFunc) (void);
|
10 | STACK void (*baudrateHook) (uint16_t);
|
11 | #if (defined(LIN_SLAVE_NODE) && defined(LIN_BAUDRATE_DETECT))
|
12 | STACK void (*baudrateCallback) (__OPTIONAL_IFC_DEFINITION_COMMA__ uint16_t);
|
13 | #endif
|
14 | #ifdef LIN_PROTOCOL_SWITCH
|
15 | STACK void (*protocolCallback) (void);
|
16 | #endif /* LIN_PROTOCOL_SWITCH */
|
17 | } IFC_CTRL_HOOKS_TYPE;
|
Hier werden anscheinend Funktionen direkt zusammengefasst und auf den
Stack gelegt.
Zumindest lese ich das raus. Korrigiert mich bitte wenn ich da falsch
liege.
Vielleicht kann mir jemand hier auf die Sprünge helfen.
Vielen Dank!