Commit Graph

726 Commits

Author SHA1 Message Date
Markus Hitter b4bf8144fc Protect usb_serial.c from Arduino IDE.
This silly "IDE" simply processes every source code file it can find ...
2012-11-08 16:38:14 +01:00
Markus Hitter 481354a4a7 serial.h: get rid of compiler warnings recently introduced. 2012-11-08 16:37:52 +01:00
Markus Hitter 7c3920a552 Distribute on/off on PWM pins to all config templates. 2012-11-08 16:37:31 +01:00
Markus Hitter 0b11812ce5 Make use of the new usb_serial (and drop usage of lufa_serial).
At this point in time not a single user of LUFA is known and
here is reported how usb_serial apparently works more reliable:

http://forums.reprap.org/read.php?147,33082,160724#msg-160724

So it's likely we can move from lufa_serial to usb_serial entirely.
2012-11-08 16:37:18 +01:00
Markus Hitter 7d6ffdae17 usb_serial.c: adjust USB strings for Teacup. 2012-11-08 16:37:03 +01:00
Markus Hitter c4fc138f7e Import USB Serial from http://www.pjrc.com/teensy/usb_serial.html 2012-11-08 16:36:48 +01:00
Markus Hitter 4510a02d7e A number of teensy-related fine-adjustments. Mostly comments. 2012-11-08 16:36:22 +01:00
Markus Hitter 8e8a3da7fb crc.c: "preheat" the checksum.
Not doing so lets a checksum succeed on (all zeros) empty memory.
2012-11-08 16:25:48 +01:00
Markus Hitter a2185a4154 temp.c: explicitely cast the EMWA algorithm result.
Contribution by DaveX, see:
http://forums.reprap.org/read.php?147,33082,160633#msg-160633
2012-11-08 16:25:35 +01:00
Markus Hitter 86e89dbac6 heater.c: review on/off behaviour again.
D'oh, this wasn't compiling without BANG_BANG.
2012-11-08 16:25:16 +01:00
Markus Hitter f455f6f709 heater.c: fix on/off when BANG_BANG is used. 2012-11-08 16:25:04 +01:00
Markus Hitter 8d91312991 heaters: allow to disable PWM on PWM-able pins.
This is not only handy for debugging non-PWM mode, it may also
help those who run a heated bed attached to a solid state relay.

This way it was found out connecting heaters to non-PWM pins
works just fine and did so for a loooong time.

Not yet distributed to all the config.h templates.
2012-11-08 16:24:53 +01:00
Markus Hitter 5a2677f685 Even more fixes for the ATmega32U4.
Patch contributed by DaveX, see
http://forums.reprap.org/read.php?147,33082,159254#msg-159254
2012-11-08 16:23:55 +01:00
Markus Hitter fbf62a7dba heater.h: remove {en|dis}able_heater().
They were unused and no longer fit the heating algorithm strategy.
2012-11-08 16:23:41 +01:00
Markus Hitter d3af5460f1 Move heater initialisation from mendel.c to heater.c.
This enhances encapsulation.

An attempt to initialise only the timers in use was abandoned.
This isn't only unneccessary, as pins are still in normal
operation mode unless their bits in TCCR0A/TCCR2A/... are set,
even with the timer behind the pins running, it's also at least
tricky to sort pins and their timer bits at compile time. Doing
the sorting at runtime would cause additional binary size.
2012-11-08 16:22:46 +01:00
Markus Hitter 8e27595a5f temp.c: allow smoothing temperature readings.
This is done by an Exponentially Weighted Moving Average (EWMA)
formula. Contribution by DaveX, see
http://forums.reprap.org/read.php?147,33082,157978#msg-157978

Thanks a lot, Dave.
2012-11-08 16:22:31 +01:00
Markus Hitter 8b05e77d49 temp.c: try to deal with flakey temperature sensors. 2012-11-08 16:22:16 +01:00
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