void SysTick_Handler ( void ) { msTicks++; if (msTicks == 500) { msTicks = 0; // reset the msTicks if ((state != 1) || (pressed == 1)) { // if not state 1 output_handler(); // write to LEDS } // else, return } }
void SingleTraceOutputModifier::InitialiseAtStart(DistributedVectorFactory* pVectorFactory) { // Collectively open the output directory - this might already be in place from creating the HDF5 file OutputFileHandler output_handler(HeartConfig::Instance()->GetOutputDirectory(), false); // Only the node owner needs to proceed here if (pVectorFactory->IsGlobalIndexLocal(mGlobalIndex)) { // Set the local index correctly mLocalIndex = mGlobalIndex - pVectorFactory->GetLow(); // Open the file as new mFileStream = output_handler.OpenOutputFile(mFilename); } }
static inline void process_thr_change (struct pc16550d *u) { // put out the character char chr = pc16550d_mem_thr_rd_raw(&u->dev); output_handler(u, chr); // writing the THR reg resets the THRE interrupt pending state if (pc16550d_mem_iir_rd(&u->dev).iid == pc16550d_mem_irq_thre) { clear_interrupt(u); } // we always simulate the transmitter register to be empty (an infinitly // fast serial line) pc16550d_mem_lsr_thre_wrf(&u->dev, 1); pc16550d_mem_lsr_temt_wrf(&u->dev, 1); process_lsr_change(u); }
void ActivationOutputModifier::FinaliseAtEnd() { //Dump out all data in a round-robin fashion OutputFileHandler output_handler(HeartConfig::Instance()->GetOutputDirectory(), false); // Belt and braces std::stringstream filepath_process_specific; filepath_process_specific << mFilename << "." << PetscTools::GetMyRank(); out_stream file_stream_process_specific = output_handler.OpenOutputFile(filepath_process_specific.str().c_str()); for (unsigned i=0; i<mLocalSize; i++) { (*file_stream_process_specific) << mFirstActivitationTimes[i] <<",\t" << mFirstRecoveryTimes[i] <<",\t" << mSecondActivitationTimes[i] <<",\t" << mSecondRecoveryTimes[i] <<"\n"; } file_stream_process_specific->close(); PetscTools::BeginRoundRobin(); { out_stream file_stream = out_stream(NULL); // Open the file as new or append if (PetscTools::AmMaster()) { file_stream = output_handler.OpenOutputFile(mFilename); } else { file_stream = output_handler.OpenOutputFile(mFilename, std::ios::app); } for (unsigned i=0; i<mLocalSize; i++) { (*file_stream) << mFirstActivitationTimes[i] <<",\t" << mFirstRecoveryTimes[i] <<",\t" << mSecondActivitationTimes[i] <<",\t" << mSecondRecoveryTimes[i] <<"\n"; } file_stream->close(); } PetscTools::EndRoundRobin(); }
/* * Relay log-messages to all active UDP/TCP connections */ static void log_handler(uint32_t level, const char *msg) { (void)level; output_handler(msg); }