Permalink
Browse files

Removed most references to heaters, temperatures and extruders.

I realise that I could have expanded on the definitions, and specified whether or not you have an extruder in the Makefile, but for the moment, its a sunny day outside :)
  • Loading branch information...
timkrins committed Jan 15, 2011
1 parent 4088371 commit eab4875ee59cd5e1508b3b92b7799531451fe829
Showing with 18 additions and 2,657 deletions.
  1. +3 −12 Makefile
  2. +0 −103 analog.c
  3. +0 −31 analog.h
  4. +0 −9 arduino.h
  5. +0 −86 calc.pl
  6. +2 −9 clock.c
  7. +0 −435 config.h.dist
  8. +0 −101 copier.c
  9. +0 −45 copier.h
  10. +3 −63 dda.c
  11. +1 −6 dda.h
  12. +0 −1 dda_queue.c
  13. +0 −312 func.sh
  14. +2 −20 fuses.h
  15. +3 −23 gcode_parse.c
  16. +0 −1 gcode_parse.h
  17. +4 −144 gcode_process.c
  18. +0 −1 gcode_process.h
  19. +0 −253 heater.c
  20. +0 −20 heater.h
  21. +0 −219 intercom.c
  22. +0 −17 intercom.h
  23. +0 −13 mendel.c
  24. +0 −312 mendel_cmd
  25. +0 −8 pinio.h
  26. +0 −25 sender.sh
  27. +0 −290 temp.c
  28. +0 −29 temp.h
  29. +0 −47 watchdog.c
  30. +0 −22 watchdog.h
View
@@ -23,18 +23,8 @@
# #
##############################################################################
-##############################################################################
-# #
-# Change these to suit your hardware #
-# #
-##############################################################################
-
-# MCU_TARGET = atmega168
-# MCU_TARGET = atmega328p
MCU_TARGET = atmega644p
-# MCU_TARGET = atmega1280
-
-# F_CPU = 16000000L
+F_CPU = 20000000L
##############################################################################
# #
@@ -59,7 +49,8 @@ MCU_TARGET = atmega644p
# #
##############################################################################
-# DEFS = -DF_CPU=$(F_CPU) -DHOST -DGEN3
+DEFS = -DF_CPU=$(F_CPU)
+#-DHOST -DGEN3
# DEFS += "-DDEBUG=1"
##############################################################################
View
103 analog.c
@@ -1,103 +0,0 @@
-#include "analog.h"
-
-#include <avr/interrupt.h>
-
-#ifndef ANALOG_MASK
- #warning ANALOG_MASK not defined - analog subsystem disabled
- #define ANALOG_MASK 0
-#endif
-
-uint8_t adc_running_mask, adc_counter;
-
-#if ANALOG_MASK & 2
- #define ANALOG_START 1
- #define ANALOG_START_MASK 2
-#elif ANALOG_MASK & 4
- #define ANALOG_START 2
- #define ANALOG_START_MASK 4
-#elif ANALOG_MASK & 8
- #define ANALOG_START 3
- #define ANALOG_START_MASK 8
-#elif ANALOG_MASK & 16
- #define ANALOG_START 4
- #define ANALOG_START_MASK 16
-#elif ANALOG_MASK & 32
- #define ANALOG_START 5
- #define ANALOG_START_MASK 32
-#elif ANALOG_MASK & 64
- #define ANALOG_START 6
- #define ANALOG_START_MASK 64
-#elif ANALOG_MASK & 128
- #define ANALOG_START 7
- #define ANALOG_START_MASK 128
-#else
- // ANALOG_MASK == 1 or 0, either way defines are the same except they're not used if ANALOG_MASK == 0
- #define ANALOG_START 0
- #define ANALOG_START_MASK 1
-#endif
-
-volatile uint16_t adc_result[8] __attribute__ ((__section__ (".bss")));
-
-void analog_init() {
- #if ANALOG_MASK > 0
- #ifdef PRR
- PRR &= ~MASK(PRADC);
- #elif defined PRR0
- PRR0 &= ~MASK(PRADC);
- #endif
-
- ADMUX = REFERENCE;
-
- // ADC frequency must be less than 200khz or we lose precision. At 16MHz system clock, we must use the full prescale value of 128 to get an ADC clock of 125khz.
- ADCSRA = MASK(ADEN) | MASK(ADPS2) | MASK(ADPS1) | MASK(ADPS0);
-
- adc_counter = 0;
- adc_running_mask = 1;
-
- AIO0_DDR &= ANALOG_MASK;
- DIDR0 = ANALOG_MASK & 0x3F;
-
- // now we start the first conversion and leave the rest to the interrupt
- ADCSRA |= MASK(ADIE) | MASK(ADSC);
- #endif /* ANALOG_MASK > 0 */
-}
-
-ISR(ADC_vect, ISR_NOBLOCK) {
- // emulate free-running mode but be more deterministic about exactly which result we have, since this project has long-running interrupts
- adc_result[ADMUX & 0x0F] = ADC;
- // find next channel
- do {
- adc_counter++;
- adc_running_mask <<= 1;
- if (adc_counter == 8) {
- adc_counter = ANALOG_START;
- adc_running_mask = ANALOG_START_MASK;
- }
- } while ((adc_running_mask & ANALOG_MASK) == 0);
-
- // start next conversion
- ADMUX = (adc_counter) | REFERENCE;
- ADCSRA |= MASK(ADSC);
-}
-
-uint16_t analog_read(uint8_t channel) {
- #if ANALOG_MASK > 0
- uint16_t r;
-
- uint8_t sreg;
- // save interrupt flag
- sreg = SREG;
- // disable interrupts
- cli();
-
- // atomic 16-bit copy
- r = adc_result[channel];
-
- // restore interrupt flag
- SREG = sreg;
-
- return r;
- #else
- return 0;
- #endif
-}
View
@@ -1,31 +0,0 @@
-#ifndef _ANALOG_H
-#define _ANALOG_H
-
-#include <stdint.h>
-
-#define REFERENCE_AREF 0
-#define REFERENCE_AVCC 64
-#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
- #define REFERENCE_1V1 192
-#elif defined (__AVR_ATmega_644__) || defined (__AVR_ATmega644p__)
- #define REFERENCE_1V1 128
- #define REFERENCE_2V56 192
-#endif
-
-#include "config.h"
-
-#ifndef REFERENCE
-#warning define REFERENCE as one of
-#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
- #warning REFERENCE_AREF, REFERENCE_AVCC or REFERENCE_1V1
-#elif defined (__AVR_ATmega_644__) || defined (__AVR_ATmega644p__)
- #warning REFERENCE_AREF, REFERENCE_AVCC, REFERENCE_1V1 or REFERENCE_2V56
-#endif
-#warning in your config.h
-#error REFERENCE undefined
-#endif
-
-void analog_init(void);
-uint16_t analog_read(uint8_t channel);
-
-#endif /* _ANALOG_H */
View
@@ -41,22 +41,13 @@
/*
ports and functions
-
added as necessary or if I feel like it- not a comprehensive list!
*/
-#if defined (__AVR_ATmega168__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega328P__)
- #include "arduino_168_328p.h"
-#endif /* _AVR_ATmega{168,328,328P}__ */
-
#if defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644PA__)
#include "arduino_644.h"
#endif /* _AVR_ATmega{644,644P,644PA}__ */
-#if defined (__AVR_ATmega1280__)
- #include "arduino_1280.h"
-#endif /* __AVR_ATmega1280__ */
-
#ifndef DIO0_PIN
#error pins for this chip not defined in arduino.h! If you write an appropriate pin definition and have this firmware work on your chip, please tell us via the forum thread
#endif
View
86 calc.pl
@@ -1,86 +0,0 @@
-#!/usr/bin/perl
-
-my ($ss, $es, $f, $dn, $dt, $a, $n0, $nn, $np, $c0, $cn, $cp, $n, $c, $t, $tp, $v, $vp);
-my ($c0_exact, $cn_exact, $v_exact, $t_exact, $vp_exact, $tp_exact);
-my ($n_pre);
-
-$ss = 300;
-$es = 400;
-$f = 16000000;
-$dn = 50000;
-
-$ssq = $ss * $ss;
-$esq = $es * $es;
-$dsq = ($esq - $ssq);
-
-# $a = $dsq / ($dn << 1);
-
-#$n0 = int(($ss * $ss) / (2 * $a));
-#$nn = int(($es * $es) / (2 * $a));
-# $n0 = int($ssq * $dn / $dsq);
-# $nn = int($esq * $dn / $dsq);
-
-$c0 = int($f / $ss);
-# $c0_exact = $f * sqrt(2 / abs($a));
-
-
-# $dt = ($es - $ss) / $a;
-
-# printf "A:\t%d-%d/%g: %d\n", $es, $ss, $dt, $a;
-# printf "N:\t%d-%d %d:%d\n", $n0, $nn, $nn - $n0, $dn, $a;
-# printf "C:\t%d\t%g\n", $c0, $c0_exact * (sqrt(abs($n0) + 1) - sqrt(abs($n0)));
-# $n = $np = $n0;
-$c = $cp = int($f / $ss);
-$end_c = int($f / $es);
-$t = $tp = $t_exact = 0;
-# $v = $vp = $ss;
-
-$n_pre = int(4 * $ssq * $dn / $dsq) | 1;
-
-# $cn_exact = $c0_exact * (sqrt(abs($n0) + 1) - sqrt(abs($n0)));
-# $v_exact = $vp_exact = $f / $cn_exact;
-
-printf "\tt:i\t\t\tdt\tn\tV\t\ta\n";
-for (0..$dn) {
- # approximation
- # $c = int($c * 1000) / 1000;
- printf "Approx:\t%8.6f:%i\t%10d\t%d\t%12.3f\t%12.3f\n", $t, $_, $c, ($n_pre / 4) - 1, $f / $c, ($t > 0)?($v - $ss) / ($t):0;
-
-# $tp = $t;
-# $cp = $c;
-# $np = $n;
-# $vp = $v;
-
- $t += $c / $f;
- if (
- (($n_pre > 0) && ($c > $end_c)) ||
- (($n_pre < 0) && ($c < $end_c))
- ) {
- $c = int($c - ((2 * $c) / $n_pre));
- $n_pre += 4;
- }
-# $v = $f / $c;
-
- # exact
-# printf "Exact:\t%8.6f:%i\t%10.3f\t%i\t%12.3f\t%12.3f\n\n", $t_exact, $_, $cn_exact, $n, $v_exact, ($t_exact > 0)?($v_exact - $ss) / ($t_exact):0
-# if ($_ % 10 == 0);
-#
-# $vp_exact = $v_exact;
-# $tp_exact = $t_exact;
-#
-# $t_exact += $cn_exact / $f;
-# $cn_exact = $c0_exact * (sqrt(abs($n) + 1) - sqrt(abs($n)));
-# $v_exact = $f / $cn_exact;
-
- # loop increment
-# if ($nn > $n0) {
-# $n++;
- $n_pre += 4;
-# }
-# else {
-# $n--;
-# $n_pre -= 4;
-# }
-}
-
-printf "dt:%8.3f\tv:%8.3f\n", int(($f / $es) + 0.5), $f / int(($f / $es) + 0.5);
View
11 clock.c
@@ -3,8 +3,6 @@
#include "pinio.h"
#include "sersendf.h"
#include "dda_queue.h"
-#include "watchdog.h"
-#include "temp.h"
#include "timer.h"
#include "debug.h"
@@ -18,26 +16,21 @@ void clock_250ms() {
ifclock(CLOCK_FLAG_1S) {
if (debug_flags & DEBUG_POSITION) {
// current position
- sersendf_P(PSTR("Pos: %ld,%ld,%ld,%ld,%lu\n"), current_position.X, current_position.Y, current_position.Z, current_position.E, current_position.F);
+ sersendf_P(PSTR("Pos: %ld,%ld,%ld,%lu\n"), current_position.X, current_position.Y, current_position.Z, current_position.F);
// target position
- sersendf_P(PSTR("Dst: %ld,%ld,%ld,%ld,%lu\n"), movebuffer[mb_tail].endpoint.X, movebuffer[mb_tail].endpoint.Y, movebuffer[mb_tail].endpoint.Z, movebuffer[mb_tail].endpoint.E, movebuffer[mb_tail].endpoint.F);
+ sersendf_P(PSTR("Dst: %ld,%ld,%ld,%lu\n"), movebuffer[mb_tail].endpoint.X, movebuffer[mb_tail].endpoint.Y, movebuffer[mb_tail].endpoint.Z, movebuffer[mb_tail].endpoint.F);
// Queue
print_queue();
}
- // temperature
- /* if (temp_get_target())
- temp_print();*/
}
}
void clock_10ms() {
// reset watchdog
wd_reset();
- temp_tick();
-
ifclock(CLOCK_FLAG_250MS) {
clock_250ms();
}
Oops, something went wrong.

0 comments on commit eab4875

Please sign in to comment.