Commit Graph

528 Commits

Author SHA1 Message Date
Jim McGee f22e691fee Convert the clock_flag variable into 3 separate varables.
This costs 2 bytes of ram, but saves 60 bytes of flash. Doing so
also eliminates the need to disable interrupts while clearing flags
in the ifclock macro.

Conflicts:

	clock.c
	timer.c
	timer.h
2011-05-15 09:56:32 +10:00
Jim McGee 1e198e16ea Fix handling of the steptimeout variable.
Steptimeout is used both inside and outside
of interrupts, and as such it needs special attention.
Specifically, the increment outside of the interrupt
context needs to occur when interrupts are disabled,
or a clear of the variable can be missed.

The variable was also made volatile. This is not strictly necessary
given the current code, but it is the more conservative approach
to dealing with the variable (and costs nothing in the current code).
2011-05-15 09:56:32 +10:00
Jim McGee b6b5ced7be Add CLI_SEI_BUG_MEMORY_BARRIER() macro that inserts a memory barrier for older versions of avr-libc that do not include a memory barrier as part of the definition of SEI() and CLI(). 2011-05-15 09:56:32 +10:00
Jim McGee 4420652549 Add standalone memory barrier function to project. 2011-05-15 09:56:32 +10:00
Jim McGee 1059f27592 Clean up delay functions and rename them to be consistent with
what was used before the inline delay approach was attempted.
2011-05-15 09:56:32 +10:00
Jim McGee 757e1258e2 Shorten waiting delay while waiting for room to place a movebuffer on the queue. 2011-05-14 02:10:01 +02:00
Markus Hitter c095fa5de3 Leverage E_ABSOLUTE into config.h's, so people recognize it.
Oh, and let's hope it works already :-)
2011-05-13 13:24:52 +02:00
Sergey Batalov 03cebb5a82 TEMP_RESIDENCY now in units of 10ms rather than next_read_time
Signed-off-by: Michael Moon <triffid.hunter@gmail.com>
2011-05-10 14:10:56 +10:00
Michael Moon 7a57b69cc1 fix delay compilation. Takes some of madscifi's ideas yet still provides fallback functions for eg; homing which uses variable delays 2011-05-10 13:55:08 +10:00
Michael Moon 1b1aea7f41 try to prevent queue locking due to non-atomic accesses and interrupt mismanagement 2011-05-10 12:43:27 +10:00
Markus Hitter ea437e8e12 delay.h, contribution by macscifi: be C89 compatible again. 2011-05-08 23:20:39 +02:00
Ben Jackson f8d8b2a471 gcode_parse.c: Send newline as char rather than PSTR 2011-05-08 00:37:03 +10:00
Ben Jackson da2a9c3d56 func.sh: Fix a potential infinite loop in mendel_readsym_target 2011-05-08 00:36:55 +10:00
Ben Jackson 7198021f4a func.sh: Replace perl eval() with hex() where appropriate. 2011-05-08 00:36:43 +10:00
triffid a01981ac70 Merge pull request #6 from madscifi/universal-delay
Eliminate overflow in the delayMicrosecondsInterruptible function.
2011-05-07 06:56:57 -07:00
Jim McGee b00c53f69e The addition of delay.h to the dependencies of (PROGRAM).elf did not have the desired effect (to force a recompile of all if delay.h changed). Removed the dependency. 2011-05-04 22:33:41 -07:00
Jim McGee 86a34ad5a2 Eliminates overflow in the delayMicrosecondsInterruptible
function.

Inline delay functions and change base function to
use __builtin_avr_delay_cycles(). Generated delays
are at least as long as the requested delay and
compensate for the system clock (based on F_CPU).

Delay functions must be called with constant values.
A compile time error is issued if they are not.

Delay.c removed as it is no longer used.
2011-05-04 20:14:46 -07:00
Michael Moon 2822721a59 improve and simplify heater pin initialisation by moving to io_init[mendel.c] and using macro magic with DEFINE_HEATER 2011-05-05 00:02:06 +10:00
Michael Moon 3e32a8f634 allow M114 to report negative positions correctly 2011-05-01 17:17:56 +10:00
Michael Moon be81a13584 make sure timer is initialised properly
Reported-by: jv4779 <jv4779@gmail.com>
2011-04-30 11:00:11 +10:00
Michael Moon 143398705c add "functionsbysize" make target 2011-04-29 10:55:42 +10:00
Michael Moon e2cb6aef72 M109 just waits if no temperature provided 2011-04-29 10:15:49 +10:00
Kieran Levin 61ca4c114e fixed temperature reading problem where ReplicatorG would freeze because there is no newline before the temperature prints out... 2011-04-29 10:15:40 +10:00
Michael Moon 74e03b7df1 allow G92 to work again after 0389289 2011-04-26 18:19:00 +10:00
Michael Moon 03892894ed remove ACCELERATION_TEMPORAL, update current_position from main loop instead of step interrupt 2011-04-26 14:45:32 +10:00
Michael Moon e108ab2548 M114 returns millimeters instead of steps 2011-04-26 14:44:17 +10:00
Markus Hitter ee481864fa gcode_parse.c: get rid of the denominator variable in decfloat_to_int().
This allows for better optimisation and saves 100 bytes binary size
accordingly. For denominator = 1, the algorithm is also significantly
simpler.
2011-04-15 02:12:13 +02:00
Markus Hitter 6896aa5236 gcode_parse.c: join the upper and the lower formula in decfloat_to_int().
This also makes rounding more accurate with exponent > 0.
Saves another 40 bytes binary size.
2011-04-15 02:12:10 +02:00
Markus Hitter 8cf8a8a44a gcode_parse.c: get rid of rounding[].
This saves 8 bytes of flash and, more important, 16 bytes of RAM.
2011-04-15 02:12:07 +02:00
Markus Hitter f41dd9c098 gcode_parse.c: make all usages of decfloat_to_int()...
... to divide either by 1 or 1000. Accordingly, a flag
can be used instead of the actual value, shrinking code
size by 70 bytes.
2011-04-15 02:12:02 +02:00
Markus Amsler 26b9a7df54 extruder: Add dummy temp sensor so analog_mask includes trim pot. 2011-04-12 20:38:28 +02:00
Markus Amsler 15f835320f Update config.gen3.h to support a heated bed over intercom. 2011-04-12 20:12:20 +02:00
Markus Amsler e937b052af Add support for multiple thermistor tables.
DEFINE_TEMP_SENSOR takes one additional argument. For TT_THERMISOR you can specify there which thermistor table to use.
2011-04-12 20:00:18 +02:00
Markus Amsler 8856dd9908 Only print queue on every G command if DEBUG_POSITION is set. 2011-04-12 01:37:11 +02:00
Markus Amsler 4b7f8fba48 Fix absolute E positioning.
Now also works with M101/M103
2011-04-12 01:36:57 +02:00
Markus Amsler 1d556e0278 Use HEATER_BED everywhere.
For intercom heated bed it may be different from HEATER_bed.
2011-04-11 22:41:50 +02:00
Michael Moon c54c964fc0 initialise heaters on timers 3/4/5 2011-04-11 11:22:09 +10:00
Markus Hitter 15ed65dbad No SEARCH_FEEDRATE_E, as E can't be searched. 2011-04-10 15:56:07 +02:00
Michael Moon ae33cb7fa2 start implementing absolute E support 2011-04-09 09:16:05 +10:00
Michael Moon b37a5d435e home Z to max if possible by default 2011-04-09 09:15:48 +10:00
Michael Moon f4e4788892 wait for queue to empty before homing 2011-04-09 09:15:22 +10:00
Markus Amsler d97a4519d3 extruder: Get rid of _CONFIG_H, like on the mainboard config. 2011-04-07 03:29:17 +02:00
Markus Amsler ad7f7f0e96 Don't set all axis to home on G92 E0 2011-04-07 03:15:47 +02:00
Markus Amsler 0a92c13051 extruder: sync heater.c 2011-04-05 02:14:34 +02:00
Markus Amsler 57a75ecbfb temp: TEMP_RESIDENCY_TIME is in seconds not in temp_ticks (=10ms) 2011-04-04 09:21:32 +10:00
Michael Moon 95e7cda9db avoid warning: 'SpecialMoveE' defined but not used 2011-04-04 09:16:52 +10:00
Markus Amsler be18eb90b8 Convert TEMP_HYSTERESIS to Celsius. 2011-04-04 09:12:54 +10:00
Markus Amsler 093d20481e heater: fix residency compare.
labs requires a signed int.
2011-04-04 09:12:54 +10:00
Markus Amsler 9860d2850f heater: only reset residency if temp really changed
Skeinforge generates sometimes multiple calls to M104/M140, which would add a slow delay on the next M101.
2011-04-04 09:12:53 +10:00
Markus Amsler 3a271ee487 intercom: make sure extruder switches to listen mode 2011-04-04 09:12:53 +10:00