Commit graph

32 commits

Author SHA1 Message Date
Richard Bowman
3997d66cde Merge in com port switching from sangaboard v4
I've refactored the use of the serial port, to store the
current serial port in a global variable in a module.
This is set to the most recent port to receive data,
and so we should always be replying to the port
that was used to initiate a command.

If SECONDARY_SERIAL_PORT is not defined, this
should result in no change - if it is, we should be
able to communicate on either port.
2023-02-22 12:05:48 +00:00
Richard Bowman
e65c290ae6 Ignore VSCode suggestion 2023-02-13 15:18:33 +00:00
Richard Bowman
ce762bdb60 Added an environment for pico using HW serial
I wasn't sure how to compile with or without
HW serial support, so I duplicated the "pico"
environment and added a -D HW_SERIAL
2023-02-13 15:18:16 +00:00
Filip Ayazi
84b06972fc Constant current driver fixes 2022-10-25 01:25:38 +01:00
Filip Ayazi
0f4e4b5289 Support HW serial in v5, clean up config 2022-10-11 01:00:31 +01:00
Filip Ayazi
351e5a6b7a Illumination support, change core, breaks hw serial
HW serial temporarily broken due to the change in pico core. This core
has a lot more features e.g. easily changing PWM frequency and supports
both pico cores (currently unused)
2022-10-06 23:04:59 +01:00
Filip Ayazi
fde7a90480 Hardware UART comms + partial v5 modules support 2022-09-03 22:04:28 +01:00
Filip Ayazi
dfd4a99f1f sangaboard v5 basic support 2022-09-03 21:59:29 +01:00
Filip Ayazi
48015c716c light_sensor: update lib filename and fix typo 2022-01-16 21:06:05 +00:00
Filip Ayazi
550c378e3c esp32: fix wiring config, decode stack traces 2022-01-16 21:05:09 +00:00
Filip Ayazi
58fe8a20f8 pico: remove GP prefix from pin numbers 2021-09-04 02:21:43 +01:00
Filip Ayazi
9aa42e7400 Add support for ESP32 platform 2021-09-04 01:19:15 +01:00
Filip Ayazi
1b8ffc88d7 Add example pico wiring configuration to boards.h 2021-08-20 02:31:21 +02:00
Filip Ayazi
6919f63009 Add build CI script 2021-07-18 05:34:24 +01:00
Filip Ayazi
e48f5e9bbf Version string bumped to v1.0-beta 2021-07-18 04:54:53 +01:00
Filip Ayazi
d949cbf29a Add example stm32 bluepill setup 2021-07-18 04:53:57 +01:00
Filip Ayazi
1dad7799ef stage: use -1 when defining ints to be retried from eeprom
On platforms without EEPROM (pico) DummyEEPROM returns the current
value, so this is needed to set the default correctly.
2021-07-18 04:48:46 +01:00
Filip Ayazi
7add8d026a Update README.md 2021-07-14 02:03:58 +00:00
Filip Ayazi
36dfc8d9bb help: add new stage command for blocking moves, style changes 2021-07-14 02:16:43 +01:00
Filip Ayazi
2fb61c4be3 style changes, add .clang-format config file 2021-07-14 02:15:50 +01:00
Filip Ayazi
1c8e725282 Reduce memory use
* Command definition now uses char * instead of String
 * registered_commands is now an array of pointers to Commands,
   previously this was an array of Command and was allocated to
   MAX_COMMANDS entries which were then overwritten with the module
   provided Commands, so every Command used twice as much memory. This
   saves ~200bytes
 * Several (u)ints are now (u)int8_t

On the nano with all modules included this reduces global RAM use from
1676 bytes to 1237 bytes (from 81.8% to 60.4%).
2021-07-14 01:47:21 +01:00
Filip Ayazi
2dab1008dc stage: set blocking moves as default
Switches the variable to non_blocking_moves so eeprom load returns false
when nothing has been set to match original firmware behaviour.
2021-07-14 01:18:27 +01:00
Filip Ayazi
638c13676b Merge branch 'check-if-moving'
Move commands were blocking in the original firmware, non-blocking moves
break some pysangaboard functions so this adds blocking moves as an
option along moving? command to check if a move is in progress and
notify-on-stop command which responds when a command finishes.

See !1 for more details.
2021-07-14 00:55:02 +01:00
Filip Ayazi
fdf7afd9d9 Make current status more clear in README 2021-07-01 21:37:42 +00:00
Richard Bowman
83aa9c113a Add a command to make moves blocking if desired 2021-06-23 20:13:41 +01:00
Richard Bowman
165f619869 notify_on_stop errors if not moving
notify_on_stop now gives an error if it's
called while the stage is not moving.
This means you can safely issue the command and await a response.
If the stage is moving, it will block until
the stage stops.  If it's not moving, it will return immediately.
2021-06-23 19:55:14 +01:00
Richard Bowman
71f0da35a2 Added command to notify when stage stops
This allows simpler emulation of blocking moves.
We may want to improve the way this works...
2021-06-23 18:54:29 +01:00
Richard Bowman
4cf54971a2 Added a command to check if the stage is moving 2021-06-23 17:16:17 +01:00
Filip Ayazi
edd0246cc5 some compatibility fixes and upload instructions 2021-06-02 00:56:23 +01:00
Filip Ayazi
35d969aadd Add endstops, light_sensor, test, many fixes
- Added endstop and light_sensor module
 - Improved configuration by splitting wiring configs to boards.h
 - Added a unit test for argument parsing
 - Fixed many smaller bugs
2021-05-25 01:43:11 +01:00
Filip Ayazi
8f66bb7da9 Fix README markdown 2021-05-21 03:36:14 +00:00
Filip Ayazi
2f78522064 Initial commit
First and incomplete version of the refactor, stage module works, including aborting moves.
2021-05-21 04:32:21 +01:00