Exemplo n.º 1
0
uint8_t MEMaction (uint8_t source) {
    if (consoleComm.verb=='?') {
        int memory;
        memory=getFreeMemory();
        toConsole("MEM:%ld",memory);;
        return COMMAND_OK;
    } else {
        toConsole("NAK:");
        return COMMAND_ERROR;
    }

}
Exemplo n.º 2
0
uint8_t NOPaction(uint8_t source) {  
    if (source==CONSOLE) {
        toConsole("DBG: Forwarding (%c%c%c)!", 
                 consoleComm.line[0], consoleComm.line[1], consoleComm.line[2]);
               toConsole(actionBuffer);
        toDevice((char *)consoleComm.line);

        return COMMAND_FORWARDED;
    }
    else {
        return COMMAND_IGNORED;
    }
}
Exemplo n.º 3
0
uint8_t LSVaction (uint8_t source) {
    if (source==CONSOLE) {
        toConsole("LSV:%s",BOM_VERSION);
        return COMMAND_OK;
    } else {
        toDevice("NAK:");
        return COMMAND_IGNORED;
    }
}    
Exemplo n.º 4
0
uint8_t NAKaction (uint8_t source) {
    if (source==CONSOLE) {
        toConsole("NAK:");
        return COMMAND_OK;
    } else {
        toDevice("NAK:");
        return COMMAND_OK;
    }
}    
Exemplo n.º 5
0
uint8_t LFRaction (uint8_t source) {
    if (source==CONSOLE) {
        free(bigbuff);
        toConsole("LFR:");
        return COMMAND_OK;
    } else {
        toDevice("NAK:");
        return COMMAND_IGNORED;
    }
}    
Exemplo n.º 6
0
uint8_t LAMaction (uint8_t source) {
    if (source==CONSOLE) {
        bigbuff=malloc(256);
        toConsole("LAM:");
        return COMMAND_OK;
    } else {
        toDevice("NAK:");
        return COMMAND_IGNORED;
    }
}    
Exemplo n.º 7
0
uint8_t NOPaction(uint8_t source) {  
    if (source==CONSOLE) {
        debug("Forwarding (%c%c%c)!", 
                  consoleComm.line[0], consoleComm.line[1], consoleComm.line[2]);
        toDevice((char *)consoleComm.line);

        return COMMAND_FORWARDED;
    }
    else if (source == DEVICE) {
        toConsole((char *)deviceComm.line);
    }
    return COMMAND_IGNORED;
}
Exemplo n.º 8
0
static void vMonitorTask(void* pvParameters)
{
    portTickType xLastWakeTime = xTaskGetTickCount();
    
    const portTickType xWakePeriod = 100;
    int ret;
    /* Infinite loop */
    while(true)
    {   //if(deviceComm.gotline){
//        if (xSemaphoreTake(deviceComm.xGotLineSemaphore,IN_NO_TIME_AT_ALL)){
//            handleDeviceInput(&deviceComm);
//            xSemaphoreGive(deviceComm.xGotLineSemaphore);
//        }
        if (consoleComm.gotline){
//        if (xSemaphoreTake(consoleComm.xGotLineSemaphore,IN_NO_TIME_AT_ALL)){
            ret=handleConsoleInput(&consoleComm);
//            xSemaphoreGive(consoleComm.xGotLineSemaphore);
          //  if(ret==COMMAND_FORWARDED){
//                if (xSemaphoreTake(deviceComm.xGotLineSemaphore,UNTIL_ITS_ANNOYING))  {
          //      while (!deviceComm.gotline) {
                    
           //     }
           //         handleDeviceInput(&deviceComm);
//                    xSemaphoreGive(deviceComm.xGotLineSemaphore);
                //}
            //}
         }
        //
        
        
        togglePin(GRN_LED);
        //SerialUSB.println("?");
        toConsole("?");
 //       vTaskDelay(100);
       vTaskDelayUntil(&xLastWakeTime, xWakePeriod);
    }
}
Exemplo n.º 9
0
void FrostEdit::applySettings() {
	loadStyleSheet(Settings::get("Appearance/StyleSheet", "").toString());
	//mSyntaxStyle.load(Settings::get("Appearance/Colorscheme").toString());
	//mSettingsMenu->setSyntaxStyle(&mSyntaxStyle);
	mFont.setFamily(Settings::get("TextEditor/Font", "Lucida Console").toString());
	mFont.setPointSize(Settings::get("TextEditor/FontSize", 10).toInt());

	for(TabWidgetFrame* tabf: mTabWidgetFrames) {
		TabWidget* wid =tabf->tabWidget();
		for(int i = 0; i < wid->count(); i++) {
			TextEdit* e = toTextEdit(wid->widget(i));
			e->setFont(mFont);
			mSyntaxStyle.applyToTextEdit(e);
		}
	}


	for(auto i: mOpenDocuments.keys()) {
		Document* doc = mOpenDocuments[i];
		TextEditor::Internal::Highlighter* hilt = doc->getHighlighter();

		if(hilt != nullptr) {
			qDebug() << "Found a highlighter!";
			mSyntaxStyle.applyToHighlighter(hilt);
			hilt->rehighlight();
		}
	}

	for(int i = 0; i < mApplicationOutput->count(); i++) {
		Console* c = toConsole(mApplicationOutput->widget(i));
		mSyntaxStyle.applyToConsole(c);
	}

	mSyntaxStyle.applyToConsole(mCompileOutput);
	mSyntaxStyle.applyToIssueList(mIssueList);

}