Commit Graph

1217 Commits

Author SHA1 Message Date
Markus Hitter fa8ec35bc1 run-in-simulavr.sh: report LED on time in clocks instead of ns. 2015-08-04 23:03:51 +02:00
Markus Hitter 77630167e7 Serial: postpone sending "ok" until a slot is free.
Previously acknoledgement was sent as soon as the command was
parsed. Accordingly, the host would send the next command and
this command would wait in the RX buffer without being parsed.

This worked reasonably, unless an incoming line of G-code was
longer than the RX buffer, in which case the line end was dropped
and parsing of the line never completed. With a 64 bytes buffer
on AVR this was rarely the case, with the 16 bytes hardware buffer
on ARM LPC1114 it happens regularly. And there's no recovering
from such a situation.

This should solve issue #52.
2015-08-04 23:03:51 +02:00
Markus Hitter a1feb32fe3 serial.c/.h: remove serial_writeblock() and ..._P().
Never used, all "blocks" we write are strings.
2015-08-04 23:01:43 +02:00
Markus Hitter 7c8f1cec87 .gitignore: make room for private stuff.
These files for local configurations tend to pile up and having
them just lying around clutters a 'git status'. Putting them
into private/ makes them invisible for Git now.

As we're on the topic, I use such Makefile targets for my printers:

sells: private/config.sells.h
sells: private/board.sells.h private/printer.sells.h
	@echo "Compiling and uploading for the Sells Mendel."
	$(MAKE) -f Makefile-AVR USER_CONFIG=private/config.sells.h \
	  MCU=atmega1284p F_CPU=20000000UL all
	avrdude -s -V -c stk500v2 -b 115200 -p $(MCU) -P /dev/ttyUSB0 \
	        -U flash:w:$(PROGRAM).hex
2015-08-04 13:48:30 +02:00
Markus Hitter eb166ce3ef timer.h: remove some obsolete stuff, replace char with uint8_t.
No functional change.
2015-08-03 12:11:19 +02:00
Markus Hitter 2af689a4db gcode_process.c: remove a redundant #ifdef DEBUG and similar. 2015-08-01 18:27:39 +02:00
Markus Hitter 99fdb99203 clock.c: make stuff used only in clock.c static to this file.
Better encapsulation, no functional change, no binary size change.
2015-08-01 16:22:10 +02:00
Markus Hitter 03ab34729e serial.h: remove an obsolete #include. 2015-07-31 02:01:36 +02:00
Markus Hitter 4e30501868 dda_lookahead.c: remove unused code. 2015-07-30 23:14:01 +02:00
Markus Hitter 6b66d7870a mendel.c: remove another three redundant #includes.
No functional change.
2015-07-30 21:46:14 +02:00
Markus Hitter 421fe3d641 Tools: add git-regtest.
This is a tool to run regression tests over a whole series of
commits. Typical usage:

  git checkout <topic branch>
  tools/git-regtest experimental

This runs 'make regressiontest' for every single commit between
experimental and HEAD of the topic branch. Very convenient to make
sure not a single commit introduces regressions.

If there are regressions, the tools stops at the commit bringing
in the regression, so you immediately know where to look.
2015-07-30 17:15:57 +02:00
Markus Hitter 5846961744 Tools: add git-step-rebase.
This is a tool for rebasing step by step, like described in
issue #81. It reliefs from all the manual typing, just rebase
a topic branch like this:

  git checkout <topic branch>
  tools/git-step-rebase experimental

Linking or copying this script somewhere into the PATH even allows
to use it from within git:

  git step-rebase ...
2015-07-30 16:21:32 +02:00
Markus Hitter 42b96e0e27 SD card: commit SD_CARD_SELECT_PIN to all the board files.
For the bigger boards like RAMPS or Rumba the pin numbers were
taken from Marlin. For the smaller boards, the pin is commented
out.
2015-07-30 15:31:57 +02:00
Phil Hord 15e8dec9b2 board.gen3.h: restore {TX,RX}_ENABLE_PIN defs.
These were dropped accidentally, I assume, during the Configtool
template conversion. Without them the INTERCOM feature does not
compile and so board.gen3.h is broken.

Add the gen3 config to testcases and regressiontests to ensure
this does not drop again.
2015-07-29 21:05:38 +02:00
Phil Hord 22b640697b Replace SIMULATOR with __AVR__ in several places.
Previously some features were excluded based on whether SIMULATOR
was defined. But in fact these should have been included when __AVR__
was defined. These used to be the same thing, but now with ARM coming
into the picture, they are not. Fix the situation so AVR includes are
truly only used when __AVR__ is defined.

The _crc16_update function appears to be specific to AVR; I've kept the
alternate implementation limited to AVR in that case in crc.c. I think
this is the right thing to do, but I am not sure. Maybe ARM has some
equivalent function in their libraries.
2015-07-29 21:05:38 +02:00
jbernardis c92dcb02e2 Configtool: thermistor table entries are now distributed by ADC.
Previously they were evenly spaced across the temperature range,
now they're evenly distributed across the ADC range ... which
is not entirely the same.

This is related to issue #176.
2015-07-27 18:04:41 +02:00
jbernardis a40f818068 Configtool: fix the logic to accept floating input.
Previously if did not read back in the table information correctly.

This is related to issue #176.
2015-07-27 18:04:32 +02:00
jbernardis feb57c3eb0 Configtool: Steinhart-Hart temperature fields should allow floats.
This is, the parameter entry fields in the GUI, not in the
generated temperature table. Allowing floats is a tiny bit more
precise and also, more importantly, less confusing for the user.
--Traumflug

This is related to issue #176.
2015-07-27 18:04:02 +02:00
Markus Hitter 4fdb2dac9e Remove file fuses.h.
Contents apparently nowhere used. Also not updated for often used
MCUs like ATmega2560 or ATmega1284P, so it can't be that
important.
2015-07-27 16:41:48 +02:00
Markus Hitter 3d005c4d60 mendel.c: remove redundant #include. 2015-07-27 16:34:13 +02:00
Markus Hitter 7212f3a23f board.nanoheart-v1.0.h: add a lost comment line. 2015-07-25 11:57:36 +02:00
Markus Hitter f09be1acbe Add configuration board.cnc-shield-v3.h.
Contribution by user madmike8 in the RepRap forum:
http://forums.reprap.org/read.php?147,33082,537026#msg-537026
2015-07-25 11:51:29 +02:00
Markus Hitter b3ff59fca1 run-in-simulavr.sh: make it aware of USER_CONFIG.
Now one can build and run tests with a custom configuration.
2015-07-24 17:37:43 +02:00
Markus Hitter c6a1f99758 Makefile-common: add perf. measurement config to regressiontests. 2015-07-24 15:17:43 +02:00
Markus Hitter 1509e5b3c8 testcases/config.h.Profiling: remove #include "arduino.h".
Was forgotten when moving this include into config_wrapper.h. Now
this config can also be used with USER_CONFIG.
2015-07-24 15:13:49 +02:00
Phil Hord 573dbfe576 Simulator: record serial data as comments, not as G-code.
We cheated before and sent the serial data in the simulator into
the G-code reporter so it could be line-buffered and then recorded
as comments in the trace-log. But this confuses the simulator
console output and is harder to manage. Revert to sending serial-out
data directly to the comment engine.

Also be less chatty about startup when connecting to a UART.
2015-07-17 16:34:20 +02:00
Phil Hord 503d2c75a1 Fix typos: "whether" and whitespace. 2015-07-17 16:16:42 +02:00
Markus Hitter 72253ed932 Revert "simulator.h: provide a minimalistic SPI fake."
After a number of simulator enhancements, it's no longer
necessary to keep SPI support entirely away from it.
2015-07-17 16:11:44 +02:00
Markus Hitter 7e649c83dc SD card: remove sd_read_char() also from the simulator.
This is related to the commit
  "SD card: move parsing closer to the metal."
2015-07-17 16:06:19 +02:00
Phil Hord 8a11a76063 Simulator: fix switch handling error.
getopt_long() requires a null entry at the end of the longopts
array. It also reports an error already when some switch is
wrong, so just exit silently when we get an unexpected value.
2015-07-17 16:03:31 +02:00
Phil Hord ad2a76b2df Add simulator SD card (and SPI, PFF) support.
Add simulator for SD card driver, plus add stubs for SPI and PFF
primarily to prevent the on-device code from being picked up by
the makefiles for the simulator.
2015-07-17 16:02:59 +02:00
Markus Hitter cd1eb4e250 Configtool: move board/printer.metadata to configtool/ ...
and rename it to board/printer.generic.h.
2015-07-17 13:38:22 +02:00
Markus Hitter 6b5156d459 Configtool: take advantage of the now recognized values.
This is for now to restore disabled values as well, not only
active ones. More uses are thinkable.
2015-07-17 13:38:15 +02:00
Markus Hitter 3795c7a36f Configtool: don't ignore disabled values.
Previously, values of ignored keys simply got lost and were
replaced with the ones from from the metadata file. Now this
value is preserved and perhaps, some time in the future, we'll
use this bit of information to to provide the right value when
re-enabling it.
2015-07-17 13:38:09 +02:00
Markus Hitter 27cf051f03 Configtool: de-duplicate insertValues().
No change in behaviour intended.
2015-07-17 13:38:02 +02:00
Markus Hitter 88b813c4ba Configtool: don't pick up values which no longer exist.
Previously they were dropped only at save time, which is too late
for the GUI. This is mostly for robustness, the case where a
value was removed from config files, but not yet from the GUI.
2015-07-17 13:37:55 +02:00
Markus Hitter a07e5a7d1e Configtool: don't try to parse help text in the loaded file.
This shouldn't change functionality and is for more robustness.
2015-07-17 13:37:48 +02:00
Markus Hitter a48d9edf67 Configtool: let the parsing method decide about values.
Shouldn't cause functional change.

So far, values commented out are still ignored, which is why the
used regexp changed. This will hopefully change in the future,
so a configuration can remember disabled values, too.
2015-07-17 13:37:42 +02:00
Markus Hitter d9e4cd1086 Configtool: let the parsing method decide what a name is.
This is mostly for code robustness.
2015-07-17 13:37:34 +02:00
Markus Hitter e7395c8dd8 Configtool: there are no simple comments in printer.metadata.
Accordingly, don't try to parse them. If they ever appear, they
need handling.
2015-07-17 13:37:26 +02:00
Markus Hitter eeee384ed6 Configtool: let the parsing method decide what a candidate is.
This is mostly for code robustness.
2015-07-17 13:37:18 +02:00
Markus Hitter 7acbf30e22 Configtool: ignore value options in board.metadata.
This solves the problem of choice menus being populated with too
many entries. Before, such menus would pick up values from
board.metadata as well as from the actually loaded file.

File printer.metadata contains no options, so no adjustment
needed there.
2015-07-17 13:37:11 +02:00
Markus Hitter 25c502d68b Configtool: save target candidate pins, not the metadata ones.
Previously, all the cancicates were replaced with the ones from
board.metadata, messing things up. Appears to work fine now,
candidates are preserved.
2015-07-17 13:37:04 +02:00
Markus Hitter 6b866e8c85 Configtool: get values back into config/*.metadata.
This has to work, else we can't provide default values for new
items.

Now loading a RAMPS board and just saving it results in an
identical file. Very well. Not so for other boards, because
disabled values still get lost.
2015-07-17 13:36:56 +02:00
jbernardis fb922735fd Configtool: process a metadata file before reading header files.
This should allow for easier addition of defines as Teacup evolves.
2015-07-17 13:36:48 +02:00
Markus Hitter 277de42b00 G-code parser: move gcode_source stuff ...
... from gcode_process.c/.h to gcode_parse.c/.h.
2015-07-17 13:31:10 +02:00
Markus Hitter 017e17801c SD card: move parsing closer to the metal.
This means a custom function in pff_diskio.c, disk_parsep(),
which replaces disk_readp(). Now it no longer reads a whole
sector for every single byte, but only once per line of G-code.

Performance is now much better than with buffered reading, the
1 MB file with 16'468 lines of comments, 64 bytes per line,
read and parses now in just 46 seconds, which means 358 lines
or 22'795 bytes per second.

Unfortunately all the binary size loss is gone compared to the
previous version, we're 68 bytes bigger than before buffer-less
parsing. Reason is the new function disk_parsep() in
pff_diskio.h. RAM usage is still low.

               ATmega...     '168   '328(P)   '644(P)     '1280
   FLASH:   22276 bytes   155.39%    72.51%    35.09%    17.27%
     RAM:    1331 bytes   129.98%    64.99%    32.50%    16.25%
  EEPROM:      32 bytes     3.12%     1.56%     1.56%     0.78%
2015-07-17 13:31:03 +02:00
Markus Hitter 75df5e3a0a SD card: don't read into a buffer, parse directly instead.
Formerly we took efforts to read only small chunks into a
(small) buffer, just to read this buffer byte by byte yet
again for parsing. It's more efficient and requires less
code to parse the character at read time directly. This
way we can read in chunks of exactly one line, making the
buffer obsolete.

First step is to implement this in mendel.c and in sd.c/.h.
This gets rid of the buffer already.

Very inefficient in pff.c and pff_diskio.c so far, more
than 40 minutes / less than 500 bytes/s for reading this
1 MB comments file. Reason is, for every single byte a
whole sector is read. Nevertheless, this attempt appears
to be on the right track.

Binary is 156 bytes smaller, 16 bytes less RAM:
               ATmega...     '168   '328(P)   '644(P)     '1280
   FLASH:   22052 bytes   153.82%    71.78%    34.73%    17.09%
     RAM:    1331 bytes   129.98%    64.99%    32.50%    16.25%
  EEPROM:      32 bytes     3.12%     1.56%     1.56%     0.78%
2015-07-17 13:30:55 +02:00
Phil Hord 3520f54db7 Makefile-example: add shortcut targets.
Add shortcuts to Makefile-example for regressiontests and program
so it can more easily be used as-is.

Remove the comment suggesting to use Makefile-AVR directly instead
since it is no longer more convenient, at least for the original
reason.
2015-07-17 13:29:22 +02:00
Phil Hord a3e956e70b Regressiontests: give SIM a "standard" config.
We should not fail the regression test if the user's config is
missing or misconfigured.

Also turn on -Werror for simulator validation, too. This might be
a bit presumptuous since we are dependent on the user's installed
gcc instance; but we already depending on him to be able to build
the simulator at all, so this doesn't seem to be too much of a
stretch.
2015-07-17 13:27:25 +02:00