Skip to content

In TRICE_MODE == 0 every TRICE macro creates its own stack frame #294

@escherstair

Description

@escherstair

I don't understand if this is related to this issue #203 (since this old issue is marked as completed), but in case TRICE_MODE == 0 every TRICE macro creates its own stack frame (with variables co, TriceBufferWritePosition and tLen).
This should come from

#ifndef TRICE_ENTER
#define TRICE_ENTER { /*! Start of TRICE macro */ \
uint32_t co[TRICE_STACK_BUFFER_MAX_SIZE>>2]; /* Check TriceDepthMax at runtime. */ \
uint32_t* TriceBufferWritePosition = co + (TRICE_DATA_OFFSET>>2);
#endif
#ifndef TRICE_LEAVE
#define TRICE_LEAVE { /*! End of TRICE macro */ \
unsigned tLen = ((TriceBufferWritePosition - co)<<2) - TRICE_DATA_OFFSET; \
TriceOut( co, tLen ); } }
#endif

but it seems that the scope of #defines is "small".

If this is by design (and cannot be improved in any way), I suggest ot add it into the documentation.

Thank in advance and a big thank you for your great job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions