void Program::Run() { Thread* th = new Thread(new ThreadStart(DELEGATE_FUNC(Program::target1))); Thread* th2 = new Thread(new ThreadStart(DELEGATE_FUNC(Program::target2))); Console::WriteLine(new String("Start threads")); th->Start(); th2->Start(); Thread::Sleep(5000); Console::WriteLine(new String("Abort Target 2")); th2->Abort(); Console::WriteLine(new String("Wait for Target 1 to finish (15 iterations)")); th->Join(); Console::WriteLine(new String("Finished")); }
void Program::Run(){ InterruptPort* button = new InterruptPort(Cpu::Pin::GPIO_Pin3, false, Port::ResistorMode::Disabled, Port::InterruptMode::InterruptEdgeLow); button->addOnInterrupt(new GPIOManager::NativeEventHandler(DELEGATE_FUNC(Program::button_OnInterrupt, _1, _2, _3))); foo = new OutputPort(Cpu::Pin::GPIO_Pin11, false); Debug::Print(new String("Started")); Thread::Sleep(-1); }