2020-05-22 00:35:29 -04:00
|
|
|
/*
|
2023-03-15 02:35:38 -04:00
|
|
|
* This file is part of the MicroPython project, http://micropython.org/
|
2020-05-22 00:35:29 -04:00
|
|
|
*
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
2023-03-15 02:35:38 -04:00
|
|
|
* Copyright (c) 2023 MicroDev
|
2020-05-22 00:35:29 -04:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2023-03-15 02:35:38 -04:00
|
|
|
#include "py/enum.h"
|
|
|
|
|
2020-05-22 00:35:29 -04:00
|
|
|
#include "shared-bindings/watchdog/WatchDogMode.h"
|
|
|
|
|
2023-03-15 02:35:38 -04:00
|
|
|
MAKE_ENUM_VALUE(watchdog_watchdogmode_type, watchdogmode, RAISE, WATCHDOGMODE_RAISE);
|
|
|
|
MAKE_ENUM_VALUE(watchdog_watchdogmode_type, watchdogmode, RESET, WATCHDOGMODE_RESET);
|
|
|
|
|
2020-05-22 00:35:29 -04:00
|
|
|
//| class WatchDogMode:
|
2023-03-15 02:35:38 -04:00
|
|
|
//| """Run state of the watchdog timer."""
|
2020-05-22 00:35:29 -04:00
|
|
|
//|
|
2023-03-15 02:35:38 -04:00
|
|
|
//| RAISE: WatchDogMode
|
|
|
|
//| """Raise an exception when the `WatchDogTimer` expires."""
|
2020-05-22 00:35:29 -04:00
|
|
|
//|
|
2020-07-25 04:58:37 -04:00
|
|
|
//| RESET: WatchDogMode
|
2023-03-15 02:35:38 -04:00
|
|
|
//| """Reset the system when the `WatchDogTimer` expires."""
|
2022-09-29 20:22:32 -04:00
|
|
|
//|
|
2023-03-15 02:35:38 -04:00
|
|
|
MAKE_ENUM_MAP(watchdog_watchdogmode) {
|
|
|
|
MAKE_ENUM_MAP_ENTRY(watchdogmode, RAISE),
|
|
|
|
MAKE_ENUM_MAP_ENTRY(watchdogmode, RESET),
|
2020-05-22 00:35:29 -04:00
|
|
|
};
|
2023-03-15 02:35:38 -04:00
|
|
|
STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogmode_locals_dict, watchdog_watchdogmode_locals_table);
|
2020-05-22 00:35:29 -04:00
|
|
|
|
2023-03-15 02:35:38 -04:00
|
|
|
MAKE_PRINTER(watchdog, watchdog_watchdogmode);
|
2020-05-26 23:25:24 -04:00
|
|
|
|
2023-03-15 02:35:38 -04:00
|
|
|
MAKE_ENUM_TYPE(watchdog, WatchDogMode, watchdog_watchdogmode);
|