Example #1
0
void ShowStateInfo(void)
{
  if (!pStateLog) return;
  State_t *pState = (State_t *)pStateLog;

  PrintS("---- State before reset ----");
  if (pState->ResetSource > 0x22) pState->ResetSource = 0x22;
  PrintS(ResetReason[pState->ResetSource >> 1]);

  PrintF("ResetCode:%s %u", ResetCode[pState->ResetCode], pState->ResetValue);
  PrintF("RadioIdle:%u", pState->RadioReadyToSleep);
  PrintF("DisplayQueue:%u", pState->DisplayQueue);
  PrintF("WrapperQueue:%u", pState->WrapperQueue);

  if (pState->ResetSource == SYSRSTIV_WDTTO || pState->ResetSource == SYSRSTIV_WDTKEY)
  {
    PrintF("# WDT %s", pState->ResetSource == SYSRSTIV_WDTTO ? "Failsafe" : "Forced");
    pState->WdtNum ++;
  }

  PrintF("Total WDT:%u", pState->WdtNum);
  PrintF("MuxMode:%s", MuxMode[pState->MuxMode]);

  unsigned char i;

  PrintW("Property:");
  for (i = 0; i < 7; ++i)
  {
    if (pState->Property & (1 << i))
      {PrintW(Property[i]); PrintC(SPACE);}
  }
  PrintR();
  
  PrintF("State:%s", Bluetooth[pState->Bluetooth]);

  PrintW("Conn:");
  for (i = 0; i < 7; ++i)
  {
    if (pState->ConnType & (1 << i))
      {PrintW(ConnType[i]); PrintC(SPACE);}
  }
  PrintR();

  PrintF("Dscnn:%u", pState->Disconnects);
  PrintF("Battery:%u%c", pState->Battery, PERCENT);
  PrintF("SrvChgdHandle:%u", pState->SrvChgdHandle);
  PrintS("-------- State end --------");
}
Example #2
0
void
CRecoveryHandler::PrintErrorW(
	LPCWSTR inFormat,
	...)
{
	va_list	argList;
	va_start(argList, inFormat);
	PrintW(PRINT_ERROR, inFormat, argList);
}
Example #3
0
void
CRecoveryHandler::PrintWarningW(
	LPCWSTR inFormat,
	...)
{
	va_list	argList;
	va_start(argList, inFormat);
	PrintW(PRINT_WARN, inFormat, argList);
}
Example #4
0
void
CRecoveryHandler::PrintTraceW(
	LPCWSTR inFormat,
	...)
{
	va_list	argList;
	va_start(argList, inFormat);
	PrintW(PRINT_TRACE, inFormat, argList);
}
Example #5
0
void
CRecoveryHandler::PrintInfoW(
	LPCWSTR inFormat,
	...)
{
	va_list	argList;
	va_start(argList, inFormat);
	PrintW(PRINT_INFO, inFormat, argList);
}
Example #6
0
void
CRecoveryHandler::PrintMessageW(
	LPCWSTR inFormat,
	...)
{
	va_list	argList;
	va_start(argList, inFormat);
	PrintW(PRINT_MSG, inFormat, argList);
}
Example #7
0
void
CStCuiView::PrintTitle(
    LPCWSTR inFormat,
    ...)
{
    va_list argList;
    va_start(argList, inFormat);
    PrintW(FOREGROUND_GREEN | FOREGROUND_INTENSITY, inFormat, argList);
}
Example #8
0
void
CStCuiView::PrintMessage(
    LPCWSTR inFormat,
    ...)
{
    va_list argList;
    va_start(argList, inFormat);
    PrintW(FOREGROUND_WHITE, inFormat, argList);
}
Example #9
0
void
CStCuiView::PrintError(
    LPCWSTR inFormat,
    ...)
{
    va_list argList;
    va_start(argList, inFormat);
    PrintW(FOREGROUND_RED | FOREGROUND_INTENSITY, inFormat, argList);
}
Example #10
0
void
CStCuiView::PrintTraceOrig(
    LPCWSTR inFormat,
    ...)
{
    va_list argList;
    va_start(argList, inFormat);
    PrintW(FOREGROUND_BLUE | FOREGROUND_INTENSITY, inFormat, argList);
}
Example #11
0
void PrintE(const char *pFormat, ...)
{
  va_list args;

  va_start(args, pFormat);
  vSprintF(Buffer, pFormat, args);
  va_end(args);

  PrintW(Buffer);
}
Example #12
0
// Updates the weights using the given learning rate, momentum and adam_beta.
// num_samples is used in the adam computation iff use_adam_ is true.
void LSTM::Update(float learning_rate, float momentum, float adam_beta,
                  int num_samples) {
#if DEBUG_DETAIL > 3
  PrintW();
#endif
  for (int w = 0; w < WT_COUNT; ++w) {
    if (w == GFS && !Is2D()) continue;
    gate_weights_[w].Update(learning_rate, momentum, adam_beta, num_samples);
  }
  if (softmax_ != NULL) {
    softmax_->Update(learning_rate, momentum, adam_beta, num_samples);
  }
#if DEBUG_DETAIL > 3
  PrintDW();
#endif
}
Example #13
0
static void DrawCallNotification(unsigned char const *pVal, int Len)
{
    PrintW("-DrwCall:");
    PrintQ(pVal, Len);

    Draw_t const *pItem = CallItem;
    Draw_t Info;
    unsigned char i = 0;

    ClearSram(NOTIF_MODE);
    // quit icon
    memcpy(&Info, pItem++, sizeof(Draw_t));
    Draw(&Info, NULL, NOTIF_MODE);

    // small phone icon
    memcpy(&Info, pItem++, sizeof(Draw_t));
    Draw(&Info, NULL, NOTIF_MODE);

    // timestamp icon
    memcpy(&Info, pItem++, sizeof(Draw_t));
    Draw(&Info, NULL, NOTIF_MODE);

    // timestamp
    memcpy(&Info, pItem++, sizeof(Draw_t));
    Draw(&Info, NULL, NOTIF_MODE);

    // call from
    memcpy(&Info, pItem++, sizeof(Draw_t));
    Info.Width = sizeof(Text) - 1;
    Draw(&Info, Text, NOTIF_MODE);

    // caller name
    memcpy(&Info, pItem, sizeof(Draw_t));

    if (*pVal >= '0' && *pVal <= '9' || *pVal == '+')
    {
        SetCallerNumber(pVal, Len);
        pVal = NoName;
        Len = sizeof(NoName) - 1;
    }

    // split and draw first, last names and call number if available
//  while (Len >= 0)
//  {
//    i = 0; while (pVal[i] != SPACE && i < Len) i++;
//
//    PrintF(" W:%u", i);
//    Info.Width = i;
//    Draw(&Info, pVal, NOTIF_MODE);
//
//    memcpy(&Info, pItem, sizeof(Draw_t));
//    Info.Y += CALLER_NAME_HEIGHT;
//    pVal += i + 1;
//    Len -= i + 1;
//  }

    i = 0;
    while (pVal[i] != SPACE && i < Len) i++;

    PrintF(" W:%u", i);
    Info.Width = i;
    Draw(&Info, pVal, NOTIF_MODE);

    if (i < Len - 1)
    {
        memcpy(&Info, pItem, sizeof(Draw_t));
        Info.Y += CALLER_NAME_HEIGHT;
        pVal += i + 1;
        Len -= i + 1;
        Info.Width = Len;
        Draw(&Info, pVal, NOTIF_MODE);
    }

    if (pCallerNumber)
    {
        memcpy(&Info, &CallItem[CALLER_NUMBER_ITEM], sizeof(Draw_t));
        Info.Width = NumberLen;
        Draw(&Info, pCallerNumber, NOTIF_MODE);

        vPortFree(pCallerNumber);
        pCallerNumber = NULL;
    }

    CreateAndSendMessage(ChangeModeMsg, NOTIF_MODE | MSG_OPT_UPD_INTERNAL);
}