void IOKey(void *argv){ reg_type receiver_control = LoadWord(RECEIVER_CONTROL); SetBit(&receiver_control, IO_INTERRUPT_ENABLE); while(!prog_finished && (WaitForSingleObject(hRunMutex, 75L) == WAIT_TIMEOUT)){ if(kbhit()){ char ch = getch(); /* for(size_t i = 0 ; i < 1000; i++) printf("Inside if kbhit() ch = %c\n", ch);*/ StoreByte(ch, RECEIVER_DATA); //muxtex in StoreByte function if(bitState(cpo_reg[STATUS], INTERRUPT_ENABLE) && bitState(cpo_reg[STATUS], EXCEPTION_LEVEL) && bitState(receiver_control, IO_INTERRUPT_ENABLE)){ SetCause(INTERRUPT); SetBit(&cpo_reg[CAUSE], 0XD);//set pending bit /*need to rectify perhaps*/ SetBit(&receiver_control, IO_READY); StoreWord(receiver_control, RECEIVER_CONTROL); /* for(size_t i = 0 ; i < 1000; i++) printf("Inside inside of kbhit() set state cause: %X\n", cpo_reg[CAUSE]);*/ }//end of if }//end of if kbhit ReleaseMutex(hRunMutex);//unlock }//end of while prog_finished }
void caBitnames::setValue(int valueP) { tf.clear(); for (int i = thisStartBit; i <= thisEndBit; i++) { if(bitState((int) valueP, i)) { tf << 1; } else { tf << 0; } } EFlag::setValue(tf); }
void MSEntryFieldCombo::buttonState(ButtonFlag button_, MSBoolean flag_) { if(button_ == TextButton) return; // use comboButtonLabel instead if(bitState(button_) != flag_) { if(flag_ == MSTrue) setBit(button_); else unsetBit(button_); switch(button_) { case UpDownArrows: if(_upArrow == 0) _upArrow=new MSArrow(this,MSArrow::Up); if(_downArrow == 0) _downArrow=new MSArrow(this,MSArrow::Down); break; case ComboButton: if (_comboArrow == 0) _comboArrow = new MSArrow(this, MSArrow::Down); default: break; } } placement(); }