Compute the max usage
This commit is contained in:
@@ -71,6 +71,8 @@
|
|||||||
uint8_t ToSend[TOSEND_BUFFER_SIZE];
|
uint8_t ToSend[TOSEND_BUFFER_SIZE];
|
||||||
int ToSendMax = -1;
|
int ToSendMax = -1;
|
||||||
|
|
||||||
|
extern uint32_t _stack_start, _stack_end;
|
||||||
|
|
||||||
|
|
||||||
static int ToSendBit;
|
static int ToSendBit;
|
||||||
struct common_area common_area __attribute__((section(".commonarea")));
|
struct common_area common_area __attribute__((section(".commonarea")));
|
||||||
@@ -359,6 +361,12 @@ static void SendStatus(void) {
|
|||||||
#endif
|
#endif
|
||||||
printConnSpeed();
|
printConnSpeed();
|
||||||
DbpString(_BLUE_("Various"));
|
DbpString(_BLUE_("Various"));
|
||||||
|
for (uint32_t *p = &_stack_start; ; ++p) {
|
||||||
|
if (*p != 0xdeadbeef) {
|
||||||
|
Dbprintf(" Max stack usage.........%d", (&_stack_end - p)*4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
Dbprintf(" DBGLEVEL................%d", DBGLEVEL);
|
Dbprintf(" DBGLEVEL................%d", DBGLEVEL);
|
||||||
Dbprintf(" ToSendMax...............%d", ToSendMax);
|
Dbprintf(" ToSendMax...............%d", ToSendMax);
|
||||||
Dbprintf(" ToSendBit...............%d", ToSendBit);
|
Dbprintf(" ToSendBit...............%d", ToSendBit);
|
||||||
@@ -2052,14 +2060,14 @@ static void PacketReceived(PacketCommandNG *packet) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern uint32_t _stack_start;
|
|
||||||
|
|
||||||
void __attribute__((noreturn)) AppMain(void) {
|
void __attribute__((noreturn)) AppMain(void) {
|
||||||
|
|
||||||
SpinDelay(100);
|
SpinDelay(100);
|
||||||
BigBuf_initialize();
|
BigBuf_initialize();
|
||||||
|
|
||||||
_stack_start = 0xdeadbeef;
|
for (uint32_t * p = &_stack_start; p < (&_stack_end) - 0x80; ++p) {
|
||||||
|
*p = 0xdeadbeef;
|
||||||
|
}
|
||||||
|
|
||||||
if (common_area.magic != COMMON_AREA_MAGIC || common_area.version != 1) {
|
if (common_area.magic != COMMON_AREA_MAGIC || common_area.version != 1) {
|
||||||
/* Initialize common area */
|
/* Initialize common area */
|
||||||
|
|||||||
Reference in New Issue
Block a user