summaryrefslogtreecommitdiff
path: root/lib/ultralib/src/debug/threadprofilestart.c
blob: 3ef8fa76e96be58c7610e2258adc7884cd376f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "osint_debug.h"

void osThreadProfileStart(void) {
    register u32 saveMask;

#ifndef NDEBUG
    if (!__osThprofFlag) {
        __osError(136, 0);
        return;
    }
    if (__osThprofFunc != NULL) {
        __osError(137, 0);
        return;
    }
#endif

    saveMask = __osDisableInt();

    __osThprofLastTimer = osGetCount();
    __osThprofFunc = osThreadProfileCallback;
    __osRestoreInt(saveMask);
}