Commit graph

52 commits

Author SHA1 Message Date
Filip Ayazi
3745e5740b Add missing board command 2023-03-10 00:49:05 +00:00
Filip Ayazi
11f0f12ee1 add get_system_status command 2023-03-09 00:06:55 +00:00
Filip Ayazi
1b3e251783 Support 4 motors
Partial support for > 4 motors, needs a clean way of defining wiring.
2023-03-09 00:05:16 +00:00
Filip Ayazi
51b5b670e6 Handle bool defaults on emulated eeprom platform platforms (fixes #5) 2023-03-08 23:53:03 +00:00
Filip Ayazi
13e9a2c598 Undo version hack 2023-03-08 01:36:31 +00:00
Filip Ayazi
5c0d38f3b2 Illumination module fixes, report as module 2023-03-08 01:22:22 +00:00
Filip Ayazi
225e208eae illumination: use comPort for test output 2023-03-01 04:56:41 +00:00
Filip Ayazi
54c34683c0 Fix serial port switching, archive firmware.elf 2023-03-01 04:52:06 +00:00
Filip Ayazi
ffb0b04c03 Merge branch 'sangaboard-v5' into 'new_env_for_hw_serial'
# Conflicts:
#   src/modules/illumination/illumination.cpp
2023-03-01 04:43:15 +00:00
Filip Ayazi
9df96aae9f constant current illumination control 2023-03-01 04:39:08 +00:00
Filip Ayazi
d3920988b5 Undo version change hack 2023-03-01 04:38:09 +00:00
Filip Ayazi
38231894ae only show 3 motor positions in p? for compatibility 2023-03-01 04:25:30 +00:00
Richard Bowman
4a8481a2d3 Save pico firmware as an artifact
In the future, we could put this on the build server.
2023-02-28 10:35:05 +00:00
Richard Bowman
d9e7c1429a Simplified configuration
I've moved SUPPORT_EEPROM into boards.h
because that seemed simplest.

I've removed a bit of logic related to serial
ports, because we now just listen on both if there
is more than one, using PRIMARY_SERIAL_PORT and
SECONDARY_SERIAL_PORT in boards.h.

I've deleted the `picohw` environment because it's no longer necessary.
2023-02-28 10:30:37 +00:00
Richard Bowman
8a18c1444c Fix precompiler directives
I mistakenly deleted an ifndef in 40439a0ead
thinking that it wasn't matched by an #endif.

This change reverts that error, and it builds properly again.
2023-02-28 10:23:24 +00:00
Richard Bowman
f0ec05cc20 Initialise EEPROM and save periodically
This should be less of a disaster for the emulated
EEPROM on the pico, but could use some finesse
2023-02-22 17:09:51 +00:00
Richard Bowman
28f7b538f0 Enable EEPROM support for pico and ATMEGA boards 2023-02-22 12:31:34 +00:00
Richard Bowman
3e4b3e97eb Store current position in EEPROM
Previously, we held our position in EEPROM so it
persisted even across power cycles.  This seems to have been lost,
so I'm restoring it.
2023-02-22 12:17:45 +00:00
Richard Bowman
40439a0ead Remove ifndef
This appears to be unterminated - I don't understand
how it compiled before, but I'm removing it to get things working again.
2023-02-22 12:12:21 +00:00
Richard Bowman
c38c0b7195 Echo back invalid commands
This was really helpful when debugging dodgy
serial connections - and shouldn't hurt anything
in normal operations.
2023-02-22 12:07:47 +00:00
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