int main(void) { ConfigPins(); initUART(); initSysTick(); RValue = initAccel(); printInteger(RValue); if (RValue == 0) { printString("Boldly going :)\r\n"); } else { printString("Inertia sensors offline :(\r\n"); } while (1) { Temperature = getTemperature(); printShort(Temperature); printString(" "); getMotion(&m); printShort(m.x_a); printString(" "); printShort(m.y_a); printString(" "); printShort(m.z_a); printString(" "); printString("\r\n"); GPIO0DATA ^= BIT2; delay(10000); } return 0; }
/* Description: This function prints two short arrays (the data part of the .wav file) Parameters: left - first array to print right - second array to print length - length of the two arrays */ void printData(short* left, short* right, int length) { //loop through the two arrays int i; for(i = 0; i < length; ++i) { //printout one short of left and right each printShort(left[i]); printShort(right[i]); } }
void MethodTable::print() { printShort(); for (int i=0; i<TABLE_SIZE; i++) { TableElement* bucket = buckets[i]; while (bucket != NULL) { CecilMethodArray* mset = bucket->methods; int klen = mset->length(); for (int k=0; k<klen; k++) { CecilMethod* cmeth = (*mset)[k]; printf("\t"); cmeth->prettyPrint(); } bucket = bucket->next; } } }
int main (int argc, char **argv) { int cc; struct parameterInfo *paramInfo; int longFormat; if (lsb_init(argv[0]) < 0) { lsb_perror("lsb_init"); return -1; } longFormat = FALSE; while ((cc = getopt(argc, argv, "Vhl")) != EOF) { switch (cc) { case 'l': longFormat = TRUE; break; case 'V': fputs(_LS_VERSION_, stderr); return 0; case 'h': usage(argv[0]); return 0; default : usage(argv[0]); return -1; } } if (!(paramInfo = lsb_parameterinfo(NULL, NULL, 0))) { lsb_perror(NULL); return -1; } if (longFormat) printLong(paramInfo); else printShort(paramInfo); return 0; }
unsigned char initClasses(void) { unsigned short numberOfclasses; unsigned short count; uint16 classDataSize; uint16 inheritanceMatrixSize; numberOfclasses = readShort(); printStr("deserializing "); printShort(numberOfclasses); printStr(" classes"); classes = _malloc_(sizeof(ClassInfo) * numberOfclasses); if (!classes) { return 0; } for (count = 0; count < numberOfclasses; count++) { ClassInfo *current = &classes[count]; printStr("."); current->superClass = readShort(); current->dimension = readByte(); current->hasLock = readByte(); current->dobjectSize = readShort(); current->pobjectSize = readShort(); { unsigned short length; length = readShort(); if (length) { current->interfaces = readClassInterfaces(length); } } current->name = readName(); } printStr("done\n"); classDataSize = readShort(); printStr("Allocating class data ["); printShort(classDataSize); printStr("]\n"); classData = _malloc_(classDataSize); if (!classData) { return 0; } inheritanceMatrixSize = readShort(); printStr("Allocating inheritanceMatrix ["); printShort(inheritanceMatrixSize); printStr("]\n"); inheritanceMatrix = _malloc_(inheritanceMatrixSize); for (count = 0; count < inheritanceMatrixSize; count++) { inheritanceMatrix[count] = readByte(); } printStr("deserializing class store configuration variables\n"); tupac = readByte(); JAVA_LANG_STRING_var = readShort(); JAVA_LANG_OBJECT_var = readShort(); JAVA_LANG_INTEGER_var = readShort(); JAVA_LANG_BYTE_var = readShort(); JAVA_LANG_SHORT_var = readShort(); JAVA_LANG_BOOLEAN_var = readShort(); JAVA_LANG_LONG_var = readShort(); JAVA_LANG_CLASS_var = readShort(); JAVA_LANG_CLASSCASTEXCEPTION_var = readShort(); JAVA_LANG_OUTOFMEMORYERROR_var = readShort(); JAVA_LANG_THROWABLE_var = readShort(); JAVA_LANG_ARITHMETICEXCEPTION_var = readShort(); VM_HARDWAREOBJECT_var = readShort(); JAVA_LANG_NULLPOINTEREXCEPTION_var = readShort(); _C_var = readShort(); _I_var = readShort(); VM_MEMORY_var = readShort(); printStr("done\n"); closeIO(); printStr("deserialized "); printShort(getByteCount()); printStr(" bytes from "); printStr(getOutputFile()); printStr("\n"); return 1; }