This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Undesired jump between functions (bind handler)

Hi everyone,

I wrote the following code to bind a function and a "number".

I test the bindHandlerInit() in the main and it works.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ------------------------------------------------------------------------- */
// CONSTANT DEFINITION
/* ------------------------------------------------------------------------- */
#define C_HANDLER_ARRAY_SIZE 256
#define C_NULL ((void*) 0L)
/* ------------------------------------------------------------------------- */
// TYPES DEFINITION
/* ------------------------------------------------------------------------- */
typedef unsigned short t_int16u;
typedef unsigned char t_int8u;
typedef t_int8u t_handlerId;
typedef struct
{
t_handlerId type;
t_int8u data[5];
t_int8u dataSizeInBytes;
} t_frame;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

However, when I add a new t_functionHandler array (uncomment line 32), the code do strange things

Fullscreen
1
//static t_functionHandler s_handlerTable2[C_HANDLER_ARRAY_SIZE];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Indeed, after executing the "bindHandler(0, process);" command (line 68), the program jump to line 80 (s_storeDataHere = p_Frame->data[0];) instead of reaching line 53 to finish the main.

When we at line 72 in the C code, we are at adress 0x20000218 in the assembly code.

When we at line 75 in the C code, we are at adress 0x2000021E in the assembly code.

I really don't understand this behaviour.

What is the probleme ?

Thank you for your help.

Best regards.

Rémi G.

0