Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pousseseringue-arduino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FabLAAS
PousseSeringue
pousseseringue-arduino
Commits
b92e0552
Commit
b92e0552
authored
1 year ago
by
David Gauchard
Browse files
Options
Downloads
Patches
Plain Diff
make emu on host work again
parent
ed8b1816
No related branches found
No related tags found
1 merge request
!17
Malaurie's work on UI + CLI interface + AccelStepper interface
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
host_gui/make.sh
+1
-1
1 addition, 1 deletion
host_gui/make.sh
motor.h
+13
-6
13 additions, 6 deletions
motor.h
pousseseringue-arduino.cpp
+7
-9
7 additions, 9 deletions
pousseseringue-arduino.cpp
pousseseringue-arduino.ino
+1
-0
1 addition, 0 deletions
pousseseringue-arduino.ino
with
22 additions
and
16 deletions
host_gui/make.sh
+
1
−
1
View file @
b92e0552
...
...
@@ -6,7 +6,7 @@ firefox=true
pwd
=
$(
pwd
)
cd
${
ESP8266ARDUINO
}
/tests/host
make
FORCE32
=
0 ssl
make
-j
10
FORCE32
=
0
USERCFLAGS
=
"-I
${
ARDUINOLIB
}
/emuAsync/replacement"
ULIBDIRS
=
${
ARDUINOLIB
}
/emuAsync:
${
ARDUINOLIB
}
/ESPUI:
${
ARDUINOLIB
}
/ArduinoJson:
${
ARDUINOLIB
}
/arduinoWebSockets
${
pwd
}
/../pousseseringue-arduino
make
-j
10
FORCE32
=
0
USERCFLAGS
=
"-I
${
ARDUINOLIB
}
/emuAsync/replacement"
ULIBDIRS
=
${
ARDUINOLIB
}
/emuAsync:
${
ARDUINOLIB
}
/ESPUI:
${
ARDUINOLIB
}
/ArduinoJson:
${
ARDUINOLIB
}
/arduinoWebSockets
:
${
ARDUINOLIB
}
/ESPWebDAV:
${
ARDUINOLIB
}
/Debouncer
${
pwd
}
/../pousseseringue-arduino
$firefox
&&
(
true
'----------------------------------------'
...
...
This diff is collapsed.
Click to expand it.
motor.h
+
13
−
6
View file @
b92e0552
...
...
@@ -8,17 +8,25 @@
#if CORE_MOCK
class
AccelStepper
{
public:
enum
{
DRIVER
,
FULL4WIRE
,
};
AccelStepper
(
uint8_t
interface
=
AccelStepper
::
FULL4WIRE
,
uint8_t
pin1
=
2
,
uint8_t
pin2
=
3
,
uint8_t
pin3
=
4
,
uint8_t
pin4
=
5
,
bool
enable
=
true
)
{}
unsigned
long
computeNewSpeed
()
{
return
10
;
}
float
maxSpeed
()
{
return
10
;
}
float
acceleration
()
{
return
5
;
}
long
distanceToGo
()
{
return
0
;
}
};
#else
#include
<AccelStepper.h>
#endif
class
isr
Stepper
:
public
AccelStepper
class
ISR
Stepper
:
public
AccelStepper
{
// usefulness: make computeNewSpeed() public to be called outside from interrupt
public:
isr
Stepper
(
uint8_t
interface
=
AccelStepper
::
FULL4WIRE
,
uint8_t
pin1
=
2
,
uint8_t
pin2
=
3
,
uint8_t
pin3
=
4
,
uint8_t
pin4
=
5
,
bool
enable
=
true
)
:
ISR
Stepper
(
uint8_t
interface
=
AccelStepper
::
FULL4WIRE
,
uint8_t
pin1
=
2
,
uint8_t
pin2
=
3
,
uint8_t
pin3
=
4
,
uint8_t
pin4
=
5
,
bool
enable
=
true
)
:
AccelStepper
(
interface
,
pin1
,
pin2
,
pin3
,
pin4
,
enable
)
{
}
// make it public
inline
unsigned
long
computeNewSpeed
()
{
return
AccelStepper
::
computeNewSpeed
();
}
};
...
...
@@ -26,9 +34,9 @@ class Motor
{
public:
using
MotorHardware_t
=
isr
Stepper
;
using
MotorHardware_t
=
ISR
Stepper
;
Motor
(
isrStepper
&
stepper
)
:
stepper
(
stepper
)
Motor
(
MotorHardware_t
&
stepper
)
:
stepper
(
stepper
)
{
setSpeedMmPerSec
(
1
);
setAccelMmPerSecPerSec
(
0.5
);
// <----- this is not yet configured by user
...
...
@@ -63,7 +71,6 @@ public:
void
setSpeedMmPerSec
(
float
mmPerSec
)
{
Serial
.
printf
(
"# set speed to %g steps/s
\n
"
,
mmToStep
(
mmPerSec
));
#if !CORE_MOCK
stepper
.
setMaxSpeed
(
mmToStep
(
mmPerSec
));
#endif
...
...
@@ -177,5 +184,5 @@ protected:
float
_retainAccel
=
-
1
;
bool
_forwardClockwise
;
isrStepper
&
stepper
;
MotorHardware_t
&
stepper
;
};
This diff is collapsed.
Click to expand it.
pousseseringue-arduino.cpp
+
7
−
9
View file @
b92e0552
...
...
@@ -6,12 +6,15 @@
#undef STASSID
#undef STAPSK
#define STASSID "hackaton"
#define STAPSK "WifiLAAS2018"
#ifndef STASSID
#define STASSID "laas-capture"
#define STAPSK ""
#endif
#if
ndef
ARDUINO_ESP8266_ADAFRUIT_HUZZAH
#if
!CORE_MOCK && !defined(
ARDUINO_ESP8266_ADAFRUIT_HUZZAH
)
#error select board Adafruit Feather HUZZAH ESP8266
#endif
...
...
@@ -43,6 +46,7 @@
#include
<Schedule.h>
#include
<interrupts.h>
// InterruptLock
using
InterruptLock
=
esp8266
::
InterruptLock
;
#if !CORE_MOCK
...
...
@@ -50,21 +54,15 @@ using InterruptLock = esp8266::InterruptLock;
SSD1306AsciiWire
oled
;
#endif // !CORE_MOCK
#include
"motor.h"
#if CORE_MOCK
isrStepper
stepper
;
#else
isrStepper
stepper
(
AccelStepper
::
DRIVER
,
STEP
,
DIR
);
#endif
#include
"Debouncer.h"
// local, debouncer, short counter, long detector
#include
"syringe.h"
#include
"cli.h"
#include
"common.h"
#include
"fs.h"
ISRStepper
stepper
(
AccelStepper
::
DRIVER
,
STEP
,
DIR
);
enum
class
Modes
{
TURN
,
TURNSetup
,
RPM
,
RPMSetup
,
INFO
};
const
char
*
msgHeader
=
MSGHEADER
;
...
...
This diff is collapsed.
Click to expand it.
pousseseringue-arduino.ino
+
1
−
0
View file @
b92e0552
...
...
@@ -8,4 +8,5 @@
#include
"syringe.cpp"
#include
"motor.cpp"
#include
"cli.cpp"
#include
"fs.cpp"
#endif // !CORE_MOCK
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment