/* function called when cmd_stack_space is parsed successfully */ static void cmd_stack_space_parsed(void *parsed_result, void *data) { #ifdef HOST_VERSION printf("not implemented\n"); #else printf("res stack: %d\r\n", min_stack_space_available()); #endif }
// this functions calls itself and consumes stack every time // the stack space indication should decrement every time // when the stack is all consumed, the processor can do crazy things. // most time it will reset void recursive_call(void) { volatile int stack_size; // volatile necessary to put variable on stack // printing the stacck space stack_size = min_stack_space_available(); printf("stack size : %i\n", stack_size); wait_ms(50); // consuming stack space recursive_call(); }
/* function called when cmd_stack_space is parsed successfully */ static void cmd_stack_space_parsed(void *parsed_result, void *data) { printf("res stack: %d\r\n", min_stack_space_available()); }