Exemplo n.º 1
0
void App_t::ITask() {
    // Filters init
    for(int i=0; i<CHNL_CNT; i++) LvlMtr[i].Reset();

    while(true) {
        uint32_t EvtMsk = chEvtWaitAny(ALL_EVENTS);
#if 1 // ==== USB ====
        if(EvtMsk & EVTMSK_USB_READY) {
            Uart.Printf("\rUsbReady");
            LedAux.SetHi();
        }
        if(EvtMsk & EVTMSK_USB_SUSPEND) {
            Uart.Printf("\rUsbSuspend");
            LedAux.SetLo();
        }

        if(EvtMsk & EVTMSK_START_LISTEN) {
        }
        if(EvtMsk & EVTMSK_STOP_LISTEN) {

        }
#endif
        if(EvtMsk & EVTMSK_UART_NEW_CMD) {
            OnCmd((Shell_t*)&Uart);
            Uart.SignalCmdProcessed();
        }

    } // while true
}
Exemplo n.º 2
0
void CCmdDlg::OnReturn()
{
	if (GetFocus() == NULL || GetFocus()->GetParent() != &m_cbInput) {
		m_cbInput.SetFocus();
		return;
	}

	UpdateData();

	if (m_strInput.GetLength() == 0)
		m_strInput = m_strLastCmd;

	if (m_strInput.GetLength() == 0)
		return;

	PrintLine(_T("> %s"), (LPCTSTR )m_strInput);

	if (OnCmd(m_strInput)) {
		m_cbInput.InsertString(0, m_strInput);

		if (m_cbInput.GetCount() >= 100)
			m_cbInput.DeleteString(m_cbInput.GetCount() - 1);
	} else {

		Print(_T("invalid command") CRLF );
	}
	
	m_strLastCmd = m_strInput;

	m_strInput.Empty();
	UpdateData(FALSE);
}
Exemplo n.º 3
0
__noreturn
void App_t::ITask() {
//    Effects.AllTogetherSmoothly(clGreen, 360);
    while(true) {
//        chThdSleepMilliseconds(2700);
//        Effects.AllTogetherNow(clGreen);
//        chThdSleepMilliseconds(270);
//        Effects.AllTogetherNow(clRed);
//        chThdSleepMilliseconds(270);
//        Effects.AllTogetherNow(clBlue);
//        chThdSleepMilliseconds(270);

//        Effects.AllTogetherSmoothly(clGreen, 180);
//        chEvtWaitAny(EVT_LEDS_DONE);
//        Effects.AllTogetherSmoothly(clRed, 180);
//        chEvtWaitAny(EVT_LEDS_DONE);
//        Effects.AllTogetherSmoothly(clBlue, 180);
//        chEvtWaitAny(EVT_LEDS_DONE);
//        Effects.AllTogetherSmoothly(clYellow, 180);
//        chEvtWaitAny(EVT_LEDS_DONE);
//        Effects.AllTogetherSmoothly(clCyan, 180);
//        chEvtWaitAny(EVT_LEDS_DONE);
//        Effects.AllTogetherSmoothly(clMagenta, 180);
//        chEvtWaitAny(EVT_LEDS_DONE);
//        Effects.AllTogetherSmoothly(clWhite, 180);
//        chEvtWaitAny(EVT_LEDS_DONE);
//        Effects.AllTogetherSmoothly(clBlack, 180);
//        chEvtWaitAny(EVT_LEDS_DONE);

        __unused eventmask_t Evt = chEvtWaitAny(ALL_EVENTS);

#if UART_RX_ENABLED
        if(EvtMsk & EVTMSK_UART_NEW_CMD) {
            OnCmd((Shell_t*)&Uart);
            Uart.SignalCmdProcessed();
        }
#endif

#if 1 // ==== Radio cmd ====
        if(Evt & EVT_RADIO_NEW_CMD) {
            Effects.AllTogetherSmoothly(clBlack, 1800);
        }
#endif
    } // while true
}