1

add string demo

This commit is contained in:
2022-07-24 01:35:34 +02:00
parent 281228b6be
commit adae600809
3 changed files with 75 additions and 1 deletions

View File

@ -6,6 +6,7 @@
#include "user/demo/PCSPKdemo.h"
#include "user/demo/PreemptiveThreadDemo.h"
#include "user/demo/SmartPointerDemo.h"
#include "user/demo/StringDemo.h"
#include "user/demo/TextDemo.h"
#include "user/demo/VBEdemo.h"
#include "user/demo/VectorDemo.h"
@ -33,7 +34,7 @@ void MainMenu::run() {
while (running) {
input = this->listener.waitForKeyEvent();
if (input >= '0' && input <= '9') {
if ((input >= '0' && input <= '9') || input == '!') {
switch (input) {
case '1':
running_demo = scheduler.ready<TextDemo>();
@ -66,6 +67,9 @@ void MainMenu::run() {
case '0':
running_demo = scheduler.ready<SmartPointerDemo>();
break;
case '!':
running_demo = scheduler.ready<StringDemo>();
break;
}
} else if (input == 'k') {
scheduler.nice_kill(running_demo); // NOTE: If thread exits itself this will throw error