Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite502e9f

Browse files
committed
modified: library.properties
modified: src/finitestate.cppmodified: src/finitestate.h
1 parent68221ef commite502e9f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

‎library.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Finite-State
2-
version=1.5.0
2+
version=1.6.0
33
author=Montree Hamarn, Natvalun Tavepontakul
44
maintainer=Montree Hamarn<montree.hamarn@gmail.com>
55
sentence=Finite-State Machine (FSM) for Arduino.

‎src/FiniteState.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void FiniteState::InternalNextStateAction(const id_t id) {
134134
}
135135

136136
voidFiniteState::InternalEntryAction(constid_t id) {
137-
_startTime =micros();
137+
_startTime =millis();
138138
_timeout =false;
139139
_eventArgs.id = id;
140140
this->InternalEventHandler(ENTRY);
@@ -161,8 +161,8 @@ const TriState FiniteState::InternalTimer() {
161161

162162
constboolFiniteState::InternalTimeout() {
163163
if (_timeout)returntrue;
164-
time_t elapsedTime =micros() - _startTime;
165-
if (elapsedTime <MS2US(_transitions[_eventArgs.id].delayTime))returnfalse;
164+
time_t elapsedTime =millis() - _startTime;
165+
if (elapsedTime < _transitions[_eventArgs.id].delayTime)returnfalse;
166166
_timeout =true;
167167
returntrue;
168168
}

‎src/FiniteState.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include"Arduino.h"
1414

15-
#defineFINITE_STATE_VERSION"1.4.3"
15+
#defineFINITE_STATE_VERSION"1.6.0"
1616
#defineFINITE_STATE_AUTHOR"MicroBeaut"
1717

1818
#defineSTATE_TRANSITION_MIN1
@@ -62,7 +62,6 @@ typedef struct {
6262

6363
classFiniteState {
6464
private:
65-
#defineMS2US(ms) (ms *1000UL)
6665
Transition *_transitions;// Tranistion Pointer
6766
uint8_t _size;// Number of Transitions
6867
EventArgs _eventArgs;// Event Argument

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp