void Task(void) { unsigned idleCount; unsigned numCtxSwitches; printString("Task started.\n"); while (1) { printString("Delaying task...\n"); YKDelayTask(2); YKEnterMutex(); numCtxSwitches = YKCtxSwCount; idleCount = YKIdleCount; YKIdleCount = 0; YKExitMutex(); printString("Task running after "); printUInt(numCtxSwitches); printString(" context switches! YKIdleCount is "); printUInt(idleCount); printString(".\n"); } }
void printV(char c,uint8_t nr, AnalogInputs::ValueType value) { printChar(c); printUInt(nr); printChar('='); printUInt(value); printNL(); }
void sendChannel3() { sendHeader(3); printUInt(StackInfo::getNeverUsedStackSize()); printD(); printUInt(StackInfo::getFreeStackSize()); printD(); sendEnd(); }
void sendChannel3() { sendHeader(3); #ifdef ENABLE_STACK_INFO //ENABLE_SERIAL_LOG printUInt(StackInfo::getNeverUsedStackSize()); printD(); printUInt(StackInfo::getFreeStackSize()); printD(); #endif sendEnd(); }
void ProgramData::createName(int index) { char *buf = name; uint8_t maxSize = PROGRAM_DATA_MAX_NAME; const char * type = pgm::read(&batteryString[battery.type]); printIndex(buf,maxSize, index); print_P (buf, maxSize, type); printChar(buf, maxSize, ' '); printUInt(buf, maxSize, battery.C); printChar(buf, maxSize, '/'); printUInt(buf, maxSize, battery.cells); }
void sendHeader(uint16_t channel) { CRC = 0; printChar('$'); printUInt(channel); printD(); printUInt(Program::programType+1); printD(); printUInt(currentTime/1000); //timestamp printChar('.'); printUInt((currentTime/100)%10); //timestamp printD(); }
void tick() { tick_counter++; printNewLine(); printString("TICK "); printUInt(tick_counter); printNewLine(); }
void lcdPrintUInt(uint16_t x) { char buf[8]; char *str = buf; uint8_t maxSize = 7; printUInt(str, maxSize, x); lcd.print(buf); }
void sendChannel2(bool adc) { sendHeader(2); ANALOG_INPUTS_FOR_ALL(it) { uint16_t v; if(adc) v = AnalogInputs::getAvrADCValue(it); else v = AnalogInputs::getRealValue(it); printUInt(v); printD(); } printUInt(Balancer::balance); printD(); uint16_t pidV=0; #ifdef ENABLE_GET_PID_VALUE pidV = hardware::getPIDValue(); #endif printUInt(pidV); printD(); sendEnd(); }
void sendChannel1() { sendHeader(1); //analog inputs for(uint8_t i=0;i < sizeOfArray(channel1);i++) { AnalogInputs::Name name = pgm::read(&channel1[i]); uint16_t v = AnalogInputs::getRealValue(name); printUInt(v); printD(); } for(uint8_t i=0;i<MAX_BANANCE_CELLS;i++) { printUInt(TheveninMethod::getReadableRthCell(i)); printD(); } printUInt(TheveninMethod::getReadableBattRth()); printD(); printUInt(TheveninMethod::getReadableWiresRth()); printD(); printUInt(Monitor::getChargeProcent()); printD(); printUInt(Monitor::getETATime()); printD(); sendEnd(); }
void sendChannel2(bool adc) { sendHeader(2); FOR_ALL_INPUTS(it) { uint16_t v; if(adc) v = AnalogInputs::getAvrADCValue(it); else v = AnalogInputs::getRealValue(it); printUInt(v); printD(); } printUInt(Balancer::balance_); printD(); uint16_t pidV=0; #ifdef ENABLE_GET_PID_VALUE pidV = hardware::getPIDValue(); #endif // printUInt(pidV); printUInt(TheveninMethod::idebug_); printD(); sendEnd(); }
//? void extern tick() void tick() { char *tick_message; tick_message = "TICK "; ++t; printNewLine(); printString(tick_message); printUInt(t); printNewLine(); //Decrement one from each TCB in Suspended list YKTickHandler(); }
void CTask(void) { int count; unsigned numCtxSwitches; YKEnterMutex(); numCtxSwitches = YKCtxSwCount; YKExitMutex(); printString("Task C started after "); printUInt(numCtxSwitches); printString(" context switches!\n"); while (1) { printString("Executing in task C.\n"); for(count = 0; count < 5000; count++); } }
void ProgramData::printIndex(char *&buf, uint8_t &maxSize, uint8_t index) { printUInt(buf, maxSize, index); printChar(buf, maxSize, ':'); }
void sendEnd() { //checksum printUInt(CRC); printNL(); }