1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-30 17:49:56 +02:00
Commit Graph

1021 Commits

Author SHA1 Message Date
Stefan de Bruijn
5be256008e Got rid of a few more defines. 2021-06-08 21:44:35 +02:00
Stefan de Bruijn
c3fd9da5a1 Default SPI miso, mosi, sck, ss pins to the "standard" gpios 19, 23, 18, 5 2021-06-08 21:24:59 +02:00
Stefan de Bruijn
3bbe92a48d Added better error reporting for incorrect configs. Added ConfigAlarm state, which you can't get out off so easily - but you are still able to upload, use files, etc. 2021-06-08 21:00:08 +02:00
Stefan de Bruijn
f38bc96195 Removed half the unit tests and fixed the rest of them. 2021-06-08 10:05:39 +02:00
Mitch Bradley
ce688e363f Simplify parser and rename handle() to various
The configuration parser no longer needs to hold two tokens.  It looks
ahead by one token as necessary.  When it finds a token at a lesser
indent level, so that token must be handled higher up in the tree,
it changes its state to "Held" so that the next call to Tokenize()
will return the same token.  The "moveNext()" logic in Parser is
thus eliminated.  The state variables for indent processing are
local variables of single routine ParserHandler::enterSection().
That routine handles parsing of a single level of the YAML tree
everywhere, including at the top level, so there is no duplication,
and only one place where things can go wrong.

The token has a state variable with these states: Bof, Matching,
Matched, Held, Eof.  Parser::is() only succeeds if the state is
Matching, and then changes the state to Matched, thus preventing
spurious matching of items when returning from a nested section
into the middle of a list of items that are being handled at a
higher level.

The heavily-overloaded function name "handle()" has been split
into several more-precise names.  item() is for a leaf configuration
item with a single value.  item() is overloaded for different
data types like int, float, bool, etc, but is not used for
hierarchical objects.  group() is for a list of items associated
with an object or base class of an object.  section() is for a
named section of the YAML tree.  group() and section() are related,
but they are used differently.  factory() is similar to group()
but it is used for Motor and Spindle factories.

The renaming makes it much easier, IMO, to figure out how the code
works.  Naming everything "handle()" hid the distinction between
things with different behaviors so that everything merged together
in your head, and searching revealed an unmanageable number of hits.
Furthermore, there are a couple of other existing uses of handle()
in the old code - namely for the input and web polling methods, and
for ISR callback handlers - further adding to the search confusion.
2021-06-07 15:09:26 -10:00
bdring
0e23acc07a Some cleanup trying to get I2S steps working 2021-06-07 16:26:13 -05:00
bdring
66a4d6eba1 Update Pin.cpp
All i2s0 pins were given the number 254.
2021-06-07 13:24:21 -05:00
Stefan de Bruijn
70907d2d47 Even more extensive test 2021-06-07 08:51:13 +02:00
Stefan de Bruijn
4749847b4d Made unit test for enums a bit bigger. 2021-06-07 08:50:18 +02:00
Stefan de Bruijn
11433470dd Fixed bug in enumitem parsing / string equals. Added unit test for yaml enums. Added some comments. 2021-06-06 19:13:39 +02:00
Stefan de Bruijn
26f40444ad Fixed PIO to support pio test. 2021-06-05 21:13:46 +02:00
Stefan de Bruijn
4b1e4aec7b Fixed last tree builder bug. 2021-06-04 23:23:31 +02:00
Stefan de Bruijn
d316af61ab Added yaml tree builder tests. Fixed nasty bug in parser handler. 2021-06-04 23:00:46 +02:00
Stefan de Bruijn
869b2aea8d Merge branch 'YamlSettings' of https://github.com/bdring/Grbl_Esp32 into YamlSettings 2021-06-04 22:02:41 +02:00
Stefan de Bruijn
12f0863c4c Added some yaml parser tests 2021-06-04 22:02:33 +02:00
Stefan de Bruijn
d79b3b29e2 Added first yaml test 2021-06-04 21:28:04 +02:00
Mitch Bradley
c2efa73baf Added fallback to AP. Useful for current YAML testing 2021-06-04 09:11:58 -10:00
Stefan de Bruijn
d52f9c085e Fixed weird issue with AP/STA in parser. 2021-06-04 20:48:23 +02:00
Mitch Bradley
c13e85a5b0 Turned of tokenizer debugging messages 2021-06-03 22:20:08 -10:00
Mitch Bradley
8ebbe52bca Tidier Wifi connection messages 2021-06-03 22:13:28 -10:00
Mitch Bradley
26204b84e6 Axis config sanity checking 2021-06-03 22:12:08 -10:00
Mitch Bradley
34ee18317b Tokenizer produces only string values
and IPAddress is a configurable type.
2021-06-03 22:06:50 -10:00
Mitch Bradley
1f2b97a2c1 Better error message for pin setup failure 2021-06-03 09:58:51 -10:00
Mitch Bradley
73ea271738 grbl_msg_sendf -> info_serial etc 2021-06-03 09:56:11 -10:00
Mitch Bradley
a190abf215 Better messages for I2SO pins 2021-06-03 09:17:07 -10:00
Mitch Bradley
7b3767e67c Fixed oops in last commit 2021-06-03 08:50:39 -10:00
Mitch Bradley
a09825c888 Terse pin error messages 2021-06-03 08:43:47 -10:00
Mitch Bradley
eb744db714 Merge branch 'YamlSettings' of https://github.com/bdring/Grbl_Esp32 into YamlSettings 2021-06-03 08:24:38 -10:00
Mitch Bradley
a999a178e8 Fixed Assert for ESP32 environment 2021-06-03 08:23:11 -10:00
bdring
12472ea7de Reverting accidental commit 2021-06-03 09:08:23 -05:00
bdring
c2b848985c Update config.yaml 2021-06-03 09:06:28 -05:00
Mitch Bradley
620de14b10 Dead code 2021-06-02 13:29:12 -10:00
Mitch Bradley
9f79d12119 Start a default AP if no comms: config 2021-06-02 12:37:17 -10:00
Stefan de Bruijn
8738b4ea71 Fixed reverse parsing of IP addresses from Yaml. 2021-06-02 22:12:15 +02:00
Stefan de Bruijn
ca858d489b Updated Wifi config to yaml style. Added yaml example of WiFi to config.yaml. Fixed a bug with strings in config. 2021-06-02 21:54:06 +02:00
Stefan de Bruijn
9bde9dcc7b First version of JSON generator for WebUI based on Machine config. 2021-06-02 20:48:42 +02:00
Stefan de Bruijn
17ff4f3c2e Merge branch 'YamlSettings' of https://github.com/bdring/Grbl_Esp32 into YamlSettings 2021-06-02 09:42:05 +02:00
Stefan de Bruijn
b04d824837 Implemented Pin. Figured out a way to work around the TrinamicDriver pins. 2021-06-02 09:41:59 +02:00
Mitch Bradley
d79e86357f More Spindle ISR improvements - less work in VFD ISR
I moved work of preparing set_rpm and set_mode commands
out into the task so the ISR routines are as short as
possible.  This makes it much easier to verify that
everything they use has IRAM_ATTR.
2021-06-01 15:02:53 -10:00
Stefan de Bruijn
00a718c11a Implemented JSON generator for WebUI [untested] 2021-06-01 20:19:07 +02:00
Stefan de Bruijn
ab962bf8b1 Added min/max limits to yaml settings. 2021-05-31 21:26:01 +02:00
Stefan de Bruijn
1380a5f34f More move semantics fixes in Pin related code. Fixed unit tests as well. 2021-05-31 20:52:40 +02:00
Stefan de Bruijn
8f3ca5509e Fixed move semantics of Pin usage. 2021-05-31 20:09:16 +02:00
Mitch Bradley
3f0488bf43 IRAM_ATTR on everything the Stepper ISR can call
Required some intrusive Spindle changes and refactoring
2021-05-30 14:34:45 -10:00
Mitch Bradley
a302935f1b Use hal timer functions because IRAM_ATTR
It is unclear whether or not the ESP-IDF functions
like timer_set_alarm_value() are interrupt safe.
The HAL timer functions all have IRAM_ATTR so
they are probably safe.
2021-05-30 10:54:47 -10:00
Mitch Bradley
d15fecd474 Removed PinLookup layer 2021-05-30 07:43:04 -10:00
Mitch Bradley
195bb1ff7e Merge branch 'YamlSettings' of https://github.com/bdring/Grbl_Esp32 into YamlSettings 2021-05-28 13:34:50 -10:00
Mitch Bradley
1347459168 Created Pin,report(legend) method
So pin reports can share code and use a consistent format
2021-05-28 13:30:17 -10:00
Mitch Bradley
38e8a93b10 Factor and reorder init
mainly so the pin messages all come before the WiFi connect dance.
2021-05-28 13:28:47 -10:00
Mitch Bradley
bf2ea18d65 setAttr() was discarding attributes from YAML 2021-05-28 13:27:16 -10:00