From f4cf0ad8eebdba68ca2b6bc84e60e7edd282d669 Mon Sep 17 00:00:00 2001 From: cfif Date: Mon, 2 Jun 2025 13:26:41 +0300 Subject: [PATCH] Init --- Inc/CliCmd/CmsisReboot.h | 14 ++++++++++++++ Src/CliCmd/CmsisReboot.c | 21 +++++++++++++++++++++ Src/CliCmd/RebootHelp.c | 12 ++++++++++++ modular.json | 22 ++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 Inc/CliCmd/CmsisReboot.h create mode 100644 Src/CliCmd/CmsisReboot.c create mode 100644 Src/CliCmd/RebootHelp.c create mode 100644 modular.json diff --git a/Inc/CliCmd/CmsisReboot.h b/Inc/CliCmd/CmsisReboot.h new file mode 100644 index 0000000..b51b59d --- /dev/null +++ b/Inc/CliCmd/CmsisReboot.h @@ -0,0 +1,14 @@ +// +// Created by xemon on 14.11.22. +// + +#ifndef UVEOS_ON_NATION_CMSISREBOOT_H +#define UVEOS_ON_NATION_CMSISREBOOT_H + +#include "CliCmd.h" + +uint8_t CliCmd_CmsisReboot(void *env, tCliCmd *cli); + +uint8_t CliCmd_rebootHelp(tCliCmd *cli); + +#endif //UVEOS_ON_NATION_CMSISREBOOT_H diff --git a/Src/CliCmd/CmsisReboot.c b/Src/CliCmd/CmsisReboot.c new file mode 100644 index 0000000..2f7f7b3 --- /dev/null +++ b/Src/CliCmd/CmsisReboot.c @@ -0,0 +1,21 @@ +// +// Created by xemon on 14.11.22. +// + +#include "CliCmd/CmsisReboot.h" +#include CMSIS_device_header + +uint8_t CliCmd_CmsisReboot(void *env, tCliCmd *cli) { + CliCmd_PrintLnStatic(cli, "THIS MODE REBOOTING DEVISES"); + CliCmd_PrintLnStatic(cli, "Reboot devises? Yes/No"); + CliCmd_WaitLine(cli); + + if (CliCmd_RxStartsWithStatic(cli, "Yes")) { + CliCmd_PrintLnStatic(cli, "Devises rebooting..."); + NVIC_SystemReset(); + } else { + CliCmd_PrintLnStatic(cli, "Cancel reboot"); + } + + return 0; +} \ No newline at end of file diff --git a/Src/CliCmd/RebootHelp.c b/Src/CliCmd/RebootHelp.c new file mode 100644 index 0000000..24c0c36 --- /dev/null +++ b/Src/CliCmd/RebootHelp.c @@ -0,0 +1,12 @@ +// +// Created by xemon on 22.12.22. +// +#include "CliCmd/CmsisReboot.h" + +uint8_t CliCmd_rebootHelp(tCliCmd *cli) { + CliCmd_PrintLnStatic(cli, " access sub commands:"); + CliCmd_PrintLnStatic(cli, " command [ Yes ] rebooting process"); + CliCmd_PrintLnStatic(cli, " command [ No ] channel as exit ib base mode"); + CliCmd_PrintLnStatic(cli, ""); + return 0; +} \ No newline at end of file diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..b9aacf9 --- /dev/null +++ b/modular.json @@ -0,0 +1,22 @@ +{ + "dep": [ + { + "type": "git", + "provider": "Smart_Components_Aurus", + "repo": "CmsisCore5" + }, + { + "type": "git", + "provider": "Smart_Components_Aurus", + "repo": "CliCmd" + } + ], + "cmake": { + "inc_dirs": [ + "Inc" + ], + "srcs": [ + "Src/**.c" + ] + } +} \ No newline at end of file