diff --git a/apps/codecs/wavpack_enc.c b/apps/codecs/wavpack_enc.c index cde208739f..eced7f1f4e 100644 --- a/apps/codecs/wavpack_enc.c +++ b/apps/codecs/wavpack_enc.c @@ -43,16 +43,6 @@ static int enc_channels; static long input_buffer[CHUNK_SIZE/2] IBSS_ATTR; -void *memset(void *s, int c, size_t n) -{ - return(ci->memset(s,c,n)); -} - -void *memcpy(void *dest, const void *src, size_t n) -{ - return(ci->memcpy(dest,src,n)); -} - /* update file header info callback function */ void enc_set_header(void *head_buffer, /* ptr to the file header data */ int head_size, /* size of this header data */ @@ -112,6 +102,8 @@ enum codec_status codec_start(struct codec_api* api) bool cpu_boosted = true; /* start boosted */ ci = api; // copy to global api pointer + + codec_init(ci); if(ci->enc_get_inputs == NULL || ci->enc_set_parameters == NULL || diff --git a/firmware/thread.c b/firmware/thread.c index aeedbac349..205375a44d 100644 --- a/firmware/thread.c +++ b/firmware/thread.c @@ -24,6 +24,9 @@ #include "kernel.h" #include "cpu.h" #include "string.h" +#ifdef RB_PROFILE +#include +#endif #define DEADBEEF ((unsigned int)0xdeadbeef) /* Cast to the the machine int type, whose size could be < 4. */ @@ -67,13 +70,6 @@ void switch_thread(bool save_context, struct thread_entry **blocked_list) static inline void store_context(void* addr) __attribute__ ((always_inline)); static inline void load_context(const void* addr) __attribute__ ((always_inline)); -#ifdef RB_PROFILE -#include -void profile_thread(void) { - profstart(cores[CURRENT_CORE].current_thread); -} -#endif - #if defined(CPU_ARM) /*--------------------------------------------------------------------------- * Store non-volatile context. @@ -372,6 +368,10 @@ static int get_threadnum(struct thread_entry *thread) return -1; } + +void profile_thread(void) { + profstart(get_threadnum(cores[CURRENT_CORE].running)); +} #endif /* Compiler trick: Don't declare as static to prevent putting