context switching between two functions

This commit is contained in:
Eggert Jung
2025-06-17 13:56:33 +02:00
parent ab76afa30a
commit c1145d28f8
4 changed files with 46 additions and 29 deletions

View File

@@ -35,17 +35,17 @@ void activeWaitDelay(uint64_t cycles) {
void Application::action() { // NOLINT
uint16_t cnt = 0;
while (1) {
//koutlock.lock();
//koutlock.lock();
{
Guarded g = Guard::enter();
//g.vault();
g.vault().kout.setPos((unsigned)0,(unsigned)Core::getID()*2+1);
g.vault().kout << cnt++ << flush;
//g.vault().kout << endl << flush;
//Guard::leave();
//koutlock.unlock();
Guarded g = Guard::enter();
//g.vault();
g.vault().kout.setPos((unsigned)0,(unsigned)Core::getID()*2+1);
g.vault().kout << cnt++ << flush;
//g.vault().kout << endl << flush;
//Guard::leave();
//koutlock.unlock();
}
Core::pause();
//activeWaitDelay(1000000000);