Commit Graph

709 Commits

Author SHA1 Message Date
Markus Hitter 68b9b33dd6 config.teensy.h: align better with config.default.h.
This updates a number of comments but shouldn't change
anything functional.
2012-10-14 22:58:45 +02:00
Markus Hitter badc8e0bbb config.teensy.h: introduce ADC channels.
Contribution from DaveX, see
http://forums.reprap.org/read.php?147,33082,158653#msg-158653
Thank you.
2012-10-14 22:58:36 +02:00
Markus Hitter a054d4c6cd Remove all remaining evidence of M109.
M109 went away a few commits ago in favour of only M116.
2012-10-14 22:57:22 +02:00
Markus Hitter b83027def2 gcode_process.c: fix a comment. 2012-10-14 22:56:26 +02:00
Markus Hitter b4d202367c gcode_process.c: fix URL sent on M115. 2012-10-14 22:56:17 +02:00
David Forrest 52ce6b5f52 More enablement of ATmega32U chip.
- ATmega32U timer 4 register handling differs from other AVRs:
  Change heater.c and mendel.c.
- LUFA USB recognition expanded in Makefile.
- Add section for __AVR_ATmega32U4__ in arduino.h.
2012-10-14 22:56:09 +02:00
David Forrest 3d02790032 Add support for an atmega32u4 on a Teensy 2.0 carrier board.
The atmega32u4 timer 4 registers differ from other AVRs, requiring
changes in heater.c and mendel.c The teensy/atmega32u4 uses LUFA USB,
but does not have 'usb' in the name, requiring changes in the
makefile PID values read from a blank EEPROM are set to default
rather than using zeros.
2012-10-14 22:56:00 +02:00
Markus Hitter 915dc4294d clock.c: silence a compiler warning. 2012-09-29 23:01:56 +02:00
Markus Hitter 47337f1213 gcode_process.c: join M250 and a stray message into M114.
Also, F is unsigned.
2012-09-29 23:01:42 +02:00
Markus Hitter d169a1fa3e gcode_process.c: remove M253: read arbitrary memory location, too.
Also pretty esoteric.
2012-09-29 23:01:17 +02:00
Markus Hitter 8e3cf55723 gcode_process.c: remove M254: write arbitrary memory location.
Pretty esoteric and I can't imagine how to make meaningful use
of this. And well, we have to make room for eeconfig commands.
2012-09-29 23:01:02 +02:00
Markus Hitter 8f94d4b421 clock.c: make clock_10ms() and clock_250ms() static.
These shouldn't be called by outside code, use clock() instead.
Surprisingly, this saves another 12 bytes binary size.
2012-09-29 23:00:39 +02:00
Markus Hitter f06b013179 clock.c: introduce clock().
This simplifies calls to clock_10ms() a bit and saves 18 bytes
binary size.
2012-09-29 23:00:24 +02:00
Markus Hitter 97a663a00c analog.c: trim down analog values storage.
Saves 10 bytes RAM and 16 bytes binary size on an 1284P (8 ADC
channels) running two sensors. Should also be a bit faster, as one
loop runs fewer iterations.

Also, checking for NUM_TEMP_SENSORS was a mistake, as temp sensors
_not_ using an analog pin exist. Extreme case is, temp sensors
exist, but zero ADC channels are used.
2012-09-29 23:00:11 +02:00
Markus Hitter c75693af38 gcode_process.c: remove support for M109.
This was deprecated in the wiki quite a while ago. Use M104,
followed by a M116, instead.

This saves a whopping 250 bytes binary size.
2012-09-29 22:59:33 +02:00
Markus Hitter fd9985ac49 config templates: fix directly numbered/unused pins. 2012-09-29 22:59:22 +02:00
Markus Hitter 94ac2b11b8 gcode_process.c: remove M107 (fan off).
To turn the fan off, use M106 S0. This aligns with RepRap's
G-code wiki page.
2012-09-29 22:59:08 +02:00
Markus Hitter 06c546959c gcode_process.c: allow controlled fan speed. 2012-09-29 22:58:39 +02:00
Markus Hitter bfad6f12cd analog.c: put in a few lessons learned.
No functional change.
2012-09-29 22:58:25 +02:00
Mikko Sivulainen bfe5e6f2fc Fixed ADC channel handling.
ADC pin is not the same as ADC channel in atmega1280/2560.
2012-09-29 22:57:55 +02:00
Markus Hitter d967ad10c0 config.gen7-1.4.h: swap thermistor pins to match v1.4.1.
This works for v1.4, too, as the mapping was arbitrary, there.
2012-09-29 22:57:41 +02:00
Markus Hitter be29ab61ae home.c: fix typo. 2012-08-22 18:52:05 +02:00
Markus Hitter 5811b49b02 Config templates: comment out FAST_PWM by default.
Also, start to limit comments in the config templates to 80 chars,
to ease reading them in the Arduino IDE.
2012-08-17 16:02:02 +02:00
Markus Hitter 931d81af58 gcode_parse.c: checksum the characters actually received.
Wow! It took something like two years to expose (and get
developer attention of) such a bug: the checksum was calculated
based on the uppercased characters parsed, not the ones actually
received over the line.
2012-08-16 23:43:21 +02:00
Markus Hitter 25aaafeff2 gcode_parse.h: remove unused union.
The idea was to clear all flags with one variable, but actually,
this raises the binary size instead of lowering it. So, the code
in gcode_parse.c, line 354, is probably as fast as it can get.
2012-08-16 23:43:07 +02:00
Markus Hitter 0ba62800eb config template: adjust the comments for the heaters.
For example, heaters currently don't work on non-PWM pins. Also,
mention special names.
2012-08-04 22:08:43 +02:00
Markus Hitter 8c6e6a1027 Fix comment on STEPS_PER_M_x in config.h templates. 2012-08-04 22:08:35 +02:00
Markus Hitter 37933c8a85 Fix temperature printing.
Remove the assumption there's always an extruder temperature
sensor and make reading on single sensors (e.g. M105 P2) more usable.

Apparently works very well, but *sigh* yet another 100 bytes of binary size.
2012-08-04 22:08:17 +02:00
Markus Hitter 24561919bf temp.c: remove a redundant variable.
This doesn't save a single byte in binary size, as the optimizer
catches this anyways.
2012-08-04 22:08:09 +02:00
Markus Hitter 9731868418 gcode_process.c: test seen_P before using P, same for seen_S / S.
There were a whole bunch of cases where P and/or S were used without
checking for the validity of the value. This led to all sorts of
confusion, for obvious reasons.
2012-08-04 22:08:01 +02:00
Markus Hitter 28cf72bfe8 Makefile: change wording regarding a newer config.default.h again.
Hope it's clear now :-)
2012-08-04 22:07:51 +02:00
Ben Gamari 677ebfcccd dda: Fix signed-ness mismatch in handling of dda->e_delta 2012-08-04 22:07:43 +02:00
Markus Hitter 674014cc70 dda.c: remove two, now obsolete warnings. 2012-08-04 22:07:34 +02:00
Markus Hitter 81f85b018d Move utility functions from dda.c to dda_math.c.
Simple cleanup, no functional change.
2012-08-04 22:07:24 +02:00
Markus Hitter e0959f7ce2 Make muldiv() inline instead of a #define, too. 2012-08-04 22:07:15 +02:00
Markus Hitter d49c0745d5 dda_maths.h: make um_to_steps_{xyze}() inline functions.
Size and speed is the same as with #defines, but now there is
type checking.
2012-08-04 22:06:59 +02:00
Markus Hitter 44be918d2a Introduce muldivQR().
This is a version of muldiv() with qn and rn precalculated,
so it can be avoided to re-calclulate it on every instance.

Yet another 116 bytes, unfortunately.
2012-08-04 22:01:30 +02:00
Markus Hitter 0068ed1e26 Use the new muldiv() to replace um_to_steps..().
This gets rid of overflows at micrometer to step conversion as
much as possible within 31 bits. It also opens the door to get
STEPS_PER_M configurable at runtime.

This also costs 290 bytes, unfortunately.
2012-08-04 22:01:16 +02:00
Markus Hitter 9359350fcc config.h templates: Sanguinololu 1.2 requires inverted enable pins.
Found by nickoe on IRC, thanks.
2012-07-17 16:04:27 +02:00
Markus Hitter 55132c0458 Makefile: don't provide means for programming fuses.
Programming fuses doesn't belong to the firmware or to firmware
uploading. Fuses have to match the hardware and the bootloader,
so they should be set when setting up these.
2012-07-16 20:15:18 +02:00
Markus Hitter 7f3c1e61ba Makefile: clarify definition of the firmware upload device in use.
Programmers typically don't do baud rate, so setting the avrdude -b
flag has to be avoided in this case.
2012-07-16 20:15:03 +02:00
Markus Hitter a2f1412aec Make muldiv() multiplicand signed.
As Andrey correctly pointed out, we need this signed. See:
http://forums.reprap.org/read.php?147,89710,130225#msg-130225
and following posts.
2012-07-16 20:13:43 +02:00
Markus Hitter 7efb895ee3 Introduce an integer multiply-divide algorithm.
We have multiplies followed by divides all over the place and
most of them are difficult to handle regarding overflows. This
new algorithm handles this fine in all cases, as long as all
three operators and the overall result fits into 32 bits.
2012-07-16 20:13:29 +02:00
Markus Hitter 3d1ebf1186 Review power supply timeout.
- Move the variable from dda.c to pinio.c.

- Reset the timeout on each power on, to guarantee a minimum PSU on time.
2012-07-16 20:13:12 +02:00
Markus Hitter 1cb40082e4 gcode_process.c: remove more redundant code.
Saves yet another 122 bytes.
2012-07-16 20:13:01 +02:00
Markus Hitter 1c998067bd Makefile: add instruction on how to get rid of an error message. 2012-07-13 15:01:27 +02:00
Markus Hitter f6d3ebf2ed sersendf.c: simplify code and save 4 bytes of RAM.
The previous code was actually misbehaving and sent this string:

  TYPE:Mendel EXTRUDER_COUNT:%d TEMP_SENSOR_COUNT:%d HEATER_COUNT:%d

(part of a string in gcode_process.c) instead of "0x". Ouch! Memory
landscape messed up?
2012-07-02 17:53:36 +02:00
Markus Hitter 305ef7a347 Fix compilation with HEATER_SANITY_CHECK defined.
The issue was introduced together with temperature sensor type
TT_NONE, in commit f9a4495aa1.
2012-07-02 12:33:44 +02:00
Markus Hitter 25e2872ecd Invert enable pins in the Gen6 config template.
It's a bit a guess, see http://forums.reprap.org/read.php?147,139138
2012-06-22 09:27:15 +02:00
Markus Hitter 886bacdbe4 temp.c: remove the delay for the MAX6675.
Suggestion by JTrantow, see also
https://github.com/triffid/Teacup_Firmware/issues/22
2012-05-21 21:00:17 +02:00