Ejemplo n.º 1
0
int main(int argc, char* const argv[]) {
    if (argc != 3) {
        std::cout << "Usage: " << argv[0] << " <gpsfile> <directory>\n";
        return 1;
    }
    size_t numThreads = std::thread::hardware_concurrency();

    std::vector<GPXPoint> gpxData;
    readGPX(argv[1], gpxData);

    // std::vector<fs::path> jpegFiles;
    wc_work_queue wq;

    thread_pool threads;
    for (size_t i=0;i<numThreads;++i) {
        threads.emplace_back(geotag_worker, std::ref(wq), std::ref(gpxData));
    }
    findJpegFiles(argv[2], wq);

    // Indicate no more files will be added
    wq.setDone();

    // Wait for all the threads
    for (auto &t : threads) {
        t.join();
    }

    return 0;
}
Ejemplo n.º 2
0
/* MAX3421 state change task and interrupt handler */
byte MAX3421E::Task( void )
{
    byte rcode = 0;
    byte pinvalue;
    //Serial.print("Vbus state: ");
    //Serial.println( vbusState, HEX );
    pinvalue = readINT();
    if( pinvalue  == LOW ) {
        rcode = IntHandler();
    }
    pinvalue = readGPX();
    if( pinvalue == LOW ) {
        GpxHandler();
    }
//    usbSM();                                //USB state machine                            
    return( rcode );   
}