예제 #1
0
void initializePeripherals()
{
  initializeGpio();
  initializeTimer();

  TIM6::startCounter();
}
예제 #2
0
void CppEditorDocument::onMimeTypeChanged()
{
    const QString &mt = mimeType();
    m_isObjCEnabled = (mt == QLatin1String(CppTools::Constants::OBJECTIVE_C_SOURCE_MIMETYPE)
                       || mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE));
    m_completionAssistProvider = mm()->completionAssistProvider();

    initializeTimer();
}
예제 #3
0
void initializePeripherals()
{
  initializeGpio();
  initializeUsart();
  initializeI2c();
  initializeTimer();
  initializeDma();
  initializeMarg();
}
예제 #4
0
void MainWindow::createThreads()
{
    pt_videoThread = new QThread(this);
    pt_videocapture = new QVideoCapture();
    pt_videocapture->moveToThread(pt_videoThread);
    connect(pt_videoThread, SIGNAL(started()), pt_videocapture, SLOT(initializeTimer()));
    connect(pt_videoThread, SIGNAL(finished()), pt_videocapture, SLOT(close()));
    connect(pt_videoThread, SIGNAL(finished()), pt_videocapture, SLOT(deleteLater()));

    pt_stasmThread = new QThread(this);
    pt_stasm = new QStasm();
    pt_stasm->moveToThread(pt_stasmThread);
    connect(pt_stasmThread, SIGNAL(finished()), pt_stasm, SLOT(deleteLater()));

    pt_opencvThread = new QThread(this);
    pt_opencv = new QOpencvProcessor();
    pt_opencv->moveToThread(pt_opencvThread);
    connect(pt_opencvThread, SIGNAL(finished()), pt_opencv, SLOT(deleteLater())); 

    pt_videowriter = new QVideoWriter();
    pt_videowriter->moveToThread(pt_videoThread);
    connect(pt_videoThread, SIGNAL(finished()), pt_videowriter, SLOT(deleteLater()));

    pt_facetracker = new QFaceTracker();
    #ifdef CASCADECLASSIFIERS_PATH
        bool res = pt_facetracker->loadFaceClassifier(QString("%1%2").arg(CASCADECLASSIFIERS_PATH, "/haarcascade_frontalface_alt2.xml").toStdString());
        qWarning("Face classifier was %s", res ? "loaded": "not loaded");
        res = pt_facetracker->loadEyeClassifier(QString("%1%2").arg(CASCADECLASSIFIERS_PATH, "/haarcascade_eye.xml").toStdString());
        qWarning("Eye classifier was %s", res ? "loaded": "not loaded");
    #else
        pt_facetracker->loadFaceClassifier("data/haarcascade_frontalface_alt2.xml");
        pt_facetracker->loadEyeClassifier("data/haarcascade_eye.xml");
    #endif
    pt_facetracker->moveToThread(pt_stasmThread);
    connect(pt_stasmThread, SIGNAL(finished()), pt_facetracker, SLOT(deleteLater()));

    qRegisterMetaType<cv::Mat>("cv::Mat");
    qRegisterMetaType<cv::RotatedRect>("cv::RotatedRect");
    connect(pt_videocapture, SIGNAL(frameUpdated(cv::Mat)), pt_opencv, SLOT(custom_algorithm(cv::Mat)), Qt::BlockingQueuedConnection);
    connect(pt_videocapture, SIGNAL(frameUpdated(cv::Mat)), pt_facetracker, SLOT(updateImage(cv::Mat)), Qt::BlockingQueuedConnection);
    connect(pt_facetracker, SIGNAL(faceUpdated(cv::Mat,cv::RotatedRect)), pt_stasm, SLOT(search_points(cv::Mat, cv::RotatedRect)));
    connect(pt_stasm, SIGNAL(landmarksUpdated(cv::Mat,const float*,uint)), ui->display, SLOT(updateImage(cv::Mat,const float*,uint)));
    connect(pt_stasm, SIGNAL(displacementsUpdated(const float*,uint)), ui->waterfall, SLOT(updateNextColumn(const float*,uint)));

    qRegisterMetaType<DataSeria>("DataSeria");
    pt_seriesanalyzer = new QSeriesAnalyzer();
    pt_seriesanalyzer->moveToThread(pt_opencvThread);
    connect(pt_opencvThread, SIGNAL(finished()), pt_seriesanalyzer, SLOT(deleteLater()));

    pt_videoThread->start();   
    pt_opencvThread->start();
    pt_stasmThread->start(QThread::HighPriority);
}
예제 #5
0
HeadUpDisplay::HeadUpDisplay(Player *player) : 
    _player(player)
{
    _node = new osg::Geode;
    _node->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
    
    _node->setUserData(this);
    _node->setUpdateCallback(new HeadUpDisplayUpdateCallback);
    
	initializeCamera();
	initializeSpeedBar();
    initializeTimer();
}
예제 #6
0
파일: System.cpp 프로젝트: usewits/TwinGame
int System::initialize(){
	//Initialize SDL
	if( SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) < 0 ) return 0;
	initializeTimer();
	if( !mRenderer->initialize() ) return 0;
	if( !mInputHandler->initialize() ) return 0;
	if( !mNetwork->initialize() ) return 0;
	if( !mObjectMgr->initialize() ) return 0;
	if( !mGame->initialize() ) return 0;

	//Temporary
	mObjectMgr->LoadSomeObjects();

	return 1;
}
예제 #7
0
int StateMachine::processMasterQuery()
{
    int statusCode;
    statusCode = ptBCM->processQueriesVectors();
    if(!statusCode)
    {
        ptBCM->closeBrokerConnection();
        LOG(WARNING) << "Could not Process Queries";

        //reestablish connection and process queries.
        LOG(WARNING) << "Connection Broken" ;
        // if connection is down then reinitialize all query vectors
        ptBCM->getQueryManagerPointer()->ReInitializeVectors();
        //delete  BrokerConnectionManager Object
        //delete ptBCM;
    }
    else
    {
        initializeTimer();
    } 
    return statusCode;
}
예제 #8
0
void MainWindow::createThreads()
{
    //-------------------Pointers for objects------------------------
    pt_improcThread = new QThread(this); // Make an own QThread for opencv interface
    pt_opencvProcessor = new QOpencvProcessor();
    std::string cascadeFilename = std::string("haarcascades/haarcascade_frontalface_alt.xml");
    #ifdef HAARCASCADES_PATH
        //cascadeFilename = std::string(HAARCASCADES_PATH) + std::string("haarcascade_frontalface_alt.xml");
        cascadeFilename = std::string(LBPCASCADES_PATH) + std::string("lbpcascade_frontalface.xml");
    #endif
    bool loadResult = pt_opencvProcessor->loadClassifier( cascadeFilename );
    qWarning("Haarcascade %s was %s", cascadeFilename.c_str(), loadResult ? "loaded" : "not loadeded");
    pt_opencvProcessor->moveToThread( pt_improcThread );
    connect(pt_improcThread, SIGNAL(finished()), pt_opencvProcessor, SLOT(deleteLater()));

    //--------------------QVideoCapture------------------------------
    pt_videoThread = new QThread(this);
    pt_videoCapture = new QVideoCapture();
    pt_videoCapture->moveToThread(pt_videoThread);
    connect(pt_videoThread, SIGNAL(started()), pt_videoCapture, SLOT(initializeTimer()));
    connect(pt_videoThread, SIGNAL(finished()), pt_videoCapture, SLOT(close()));
    connect(pt_videoThread, SIGNAL(finished()), pt_videoCapture, SLOT(deleteLater()));

    //----------Register openCV types in Qt meta-type system---------
    qRegisterMetaType<cv::Mat>("cv::Mat");
    qRegisterMetaType<cv::Rect>("cv::Rect");

    //----------------------Connections------------------------------
    //connect(pt_videoCapture, SIGNAL(frame_was_captured(cv::Mat)), pt_opencvProcessor, SLOT(custom_algorithm(cv::Mat)),Qt::BlockingQueuedConnection);
    connect(pt_videoCapture, SIGNAL(frame_was_captured(cv::Mat)), pt_opencvProcessor, SLOT(searchFace(cv::Mat)),Qt::BlockingQueuedConnection);
    connect(pt_opencvProcessor, SIGNAL(frame_was_processed(cv::Mat,double)), pt_display, SLOT(updateImage(cv::Mat,double)), Qt::BlockingQueuedConnection);
    connect(pt_display, SIGNAL(selectionUpdated(cv::Rect)), pt_opencvProcessor, SLOT(setRect(cv::Rect)));

    //----------------------Thread start-----------------------------
    pt_improcThread->start();
    pt_videoThread->start();
}
예제 #9
0
파일: main.c 프로젝트: meowcatgirl/18349
int kmain(int argc, char** argv, uint32_t table)
{
	app_startup(); /* bss is valid after this point */
	global_data = table;

	unsigned long int oldInstr, oldInstr2, exitVal, *s_addr;
	unsigned long int *irq_addr, oldIrq, oldIrq2, *ubootIrqAddr;
	unsigned long int *pointer, *ubootSwiAddr;
	unsigned long int *irqPointer;
	uint32_t ICMR, ICLR, OIER;


	pointer = (unsigned long int*) 0x08;
	irqPointer = (unsigned long int*) 0x18;
	initializeTimer();

	oldInstr = *pointer;
	oldInstr2 = *(pointer+1);

	if((oldInstr & 0xfe1ff000) != 0xe41ff000) {
		return 0xbadc0de;
	}

	if((oldInstr & 0x00800000) == 0x00800000) 
		s_addr = (unsigned long int*) ((oldInstr & 0xfff) + 0x10);
	else
		s_addr = (unsigned long int*) (0x10 - (oldInstr & 0xfff));

	ubootSwiAddr = (unsigned long int*) *(s_addr);


	oldIrq = *irqPointer;
	oldIrq2 = *(irqPointer+1);

	printf("hello");
	if((oldIrq & 0xfe1ff000) != 0xe41ff000) {
		return 0xbadc0de;
	}

	if((oldIrq & 0x00800000) == 0x00800000)
		irq_addr = (unsigned long int*) ((oldIrq & 0xfff) + 0x10);
	else
		irq_addr = (unsigned long int*) (0x10 - (oldIrq & 0xfff));

	ubootIrqAddr = (unsigned long int*) *(irq_addr);

	*(ubootSwiAddr) = 0xe51ff004;
	*(ubootSwiAddr + 1) = (unsigned) &S_Handler;

	*(ubootIrqAddr) = 0xe51ff004;
	*(ubootIrqAddr+1) = (unsigned) &I_Handler;

	printf("hey");
	ICMR = reg_read(INT_ICMR_ADDR);
	ICLR = reg_read(INT_ICLR_ADDR);
	OIER = reg_read(OSTMR_OIER_ADDR);

	// set osmr match reg bit to 1 for interrupts
	reg_write(INT_ICMR_ADDR, 0x04000000);
	//make interrupts irq
	reg_write(INT_ICLR_ADDR, 0x0);
	// set match reg
	reg_write(OSTMR_OSMR_ADDR(0), 32500);
	// enable os timer interrupt for match 0 reg
	reg_write(OSTMR_OIER_ADDR, OSTMR_OIER_E0);
	// set clock reg to 0
	reg_write(OSTMR_OSCR_ADDR, 0x0);
	//clear status reg
	reg_write(OSTMR_OSSR_ADDR, 0x0);
	printf("tit");

	exitVal = (int)load_user_prog(argc, argv);

	*(ubootSwiAddr) = (unsigned long int) oldInstr;
	*(ubootSwiAddr + 1) = (unsigned long int) oldInstr2;

	*(ubootIrqAddr) = (unsigned long int) oldIrq;
	*(ubootIrqAddr+1) = (unsigned long int) oldIrq2;

	// restore interrupt shit
	reg_write(INT_ICMR_ADDR, ICMR);
	reg_write(INT_ICLR_ADDR, ICLR);
	reg_write(OSTMR_OIER_ADDR, OIER);

	return exitVal;
}