static void HandleMusicPlayStateChange(unsigned char State) { // music icon fits into one message PrintStringAndDecimal("- HdlMusicPlyChg:", State); tMessage Msg; SetupMessageAndAllocateBuffer(&Msg, WriteBufferMsg, MUSIC_MODE | MSG_OPT_WRTBUF_MULTILINE | ICON_MUSIC_WIDTH << 3); Msg.pBuffer[0] = MUSIC_STATE_START_ROW; Msg.Length = ICON_MUSIC_WIDTH * ICON_MUSIC_HEIGHT + 1; PrintStringAndTwoDecimals("- start:", Msg.pBuffer[0], "L:", Msg.Length); unsigned char i = 1; for (; i < Msg.Length; ++i) Msg.pBuffer[i] = pIconMusicState[1 - State][i - 1]; RouteMsg(&Msg); SendMessage(&Msg, UpdateDisplayMsg, MUSIC_MODE); }
/* callback from FreeRTOS * * if the bt stack is open and closed enough then memory becomes fragmented * enough so that a failure occurs * */ void vApplicationMallocFailedHook(size_t xWantedSize) { PrintStringAndTwoDecimals("@ Ask: ",(unsigned int)xWantedSize, " Free: ", xPortGetFreeHeapSize()); __no_operation(); }