mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 17:20:30 +08:00
parent
38f2da2e2e
commit
fa01d92dde
@ -23,16 +23,23 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
#include <libmaple/iwdg.h>
|
||||||
|
|
||||||
|
|
||||||
namespace DRIVERS {
|
namespace DRIVERS {
|
||||||
class BoardStm32 : public Board {
|
class BoardStm32 : public Board {
|
||||||
public:
|
public:
|
||||||
BoardStm32() : Board(BOARD){
|
BoardStm32() : Board(BOARD){
|
||||||
|
//2 sec timeout
|
||||||
|
iwdg_init(IWDG_PRE_16, 0xFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset() override {
|
void reset() override {
|
||||||
nvic_sys_reset();
|
nvic_sys_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void periodic() {
|
||||||
|
iwdg_feed();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,5 +29,6 @@ namespace DRIVERS {
|
|||||||
struct Board : public Driver {
|
struct Board : public Driver {
|
||||||
using Driver::Driver;
|
using Driver::Driver;
|
||||||
virtual void reset() {}
|
virtual void reset() {}
|
||||||
|
virtual void periodic() {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -242,6 +242,7 @@ void loop() {
|
|||||||
|
|
||||||
_out.kbd->periodic();
|
_out.kbd->periodic();
|
||||||
_out.mouse->periodic();
|
_out.mouse->periodic();
|
||||||
|
_board->periodic();
|
||||||
|
|
||||||
# ifdef CMD_SERIAL
|
# ifdef CMD_SERIAL
|
||||||
static unsigned long last = micros();
|
static unsigned long last = micros();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user