54 static uint8_t stack[FAT_COOP_STACK_SIZE];
55 static uint8_t *sp = 0;
56 static uint8_t *sp_save = 0;
70 memset(stack, 0, FAT_COOP_STACK_SIZE);
73 stack[FAT_COOP_STACK_SIZE - 1] = (
unsigned char)((
unsigned short)
coop_finished_op) & 0xff;
74 stack[FAT_COOP_STACK_SIZE - 2] = (
unsigned char)((
unsigned short)
coop_finished_op >> 8) & 0xff;
77 stack[FAT_COOP_STACK_SIZE - 3] = (
unsigned char)((
unsigned short)
operation) & 0xff;
78 stack[FAT_COOP_STACK_SIZE - 4] = (
unsigned char)((
unsigned short)
operation >> 8) & 0xff;
86 stack[FAT_COOP_STACK_SIZE - 29] = (
unsigned char)((
unsigned short)data) & 0xff;
87 stack[FAT_COOP_STACK_SIZE - 30] = (
unsigned char)((
unsigned short)data >> 8) & 0xff;
91 sp = &stack[FAT_COOP_STACK_SIZE - 1 - 4 - 32];
143 if( sp_save ==
NULL ) {
144 sp_save = (uint8_t *) SP;
148 SP = (uint16_t) sp_save;
206 int calc_free_stack() {
209 for( i = 0; i < FAT_COOP_STACK_SIZE; i++ ) {