ARM: get temp.c in.

No code changes, but quite a few removals of __ARMEL_NOTYET__
guards. 20 such guards left.

Test: M105 should work and report plausible temperatures.

Current code size:

    SIZES          ARM...     lpc1114
    FLASH  :  9460 bytes          29%
    RAM    :  1258 bytes          31%
    EEPROM :     0 bytes           0%
This commit is contained in:
Markus Hitter 2015-08-07 14:32:24 +02:00
parent 6b6aa84124
commit 8f24fbaad4
6 changed files with 7 additions and 19 deletions

View File

@ -100,10 +100,10 @@ TARGET = $(PROGRAM).hex
SOURCES = mendel.c cpu.c serial.c sermsg.c sersendf.c delay.c
SOURCES += gcode_parse.c gcode_process.c pinio.c timer.c clock.c
SOURCES += dda_queue.c dda_maths.c dda_kinematics.c dda.c dda_lookahead.c
SOURCES += analog.c
SOURCES += analog.c temp.c
# Sources left:
# home.c crc.c intercom.c debug.c spi.c usb_serial.c
# graycode.c pff.c temp.c watchdog.c heater.c pff_diskio.c
# graycode.c pff.c watchdog.c heater.c pff_diskio.c
ifeq ($(MCU), lpc1114)
SOURCES += cmsis-system_lpc11xx.c

View File

@ -118,9 +118,7 @@ static void clock_10ms(void) {
// reset watchdog
wd_reset();
#ifndef __ARMEL_NOTYET__
temp_sensor_tick();
#endif /* __ARMEL_NOTYET__ */
ifclock(clock_flag_250ms) {
clock_250ms();

View File

@ -81,7 +81,6 @@ void queue_step() {
if (current_movebuffer->live) {
if (current_movebuffer->waitfor_temp) {
timer_set(HEATER_WAIT_TIMEOUT, 0);
#ifndef __ARMEL_NOTYET__
if (temp_achieved()) {
current_movebuffer->live = current_movebuffer->done = 0;
serial_writestr_P(PSTR("Temp achieved\n"));
@ -89,7 +88,6 @@ void queue_step() {
else {
temp_print(TEMP_SENSOR_none);
}
#endif /* __ARMEL_NOTYET__ */
}
else {
dda_step(current_movebuffer);

View File

@ -346,9 +346,7 @@ void process_gcode_command() {
}
}
else if (next_target.seen_M) {
#ifndef __ARMEL_NOTYET__
uint8_t i;
#endif /* __ARMEL_NOTYET__ */
switch (next_target.M) {
case 0:
@ -369,10 +367,8 @@ void process_gcode_command() {
//? http://linuxcnc.org/handbook/RS274NGC_3/RS274NGC_33a.html#1002379
//?
queue_wait();
#ifndef __ARMEL_NOTYET__
for (i = 0; i < NUM_HEATERS; i++)
temp_set(i, 0);
#endif /* __ARMEL_NOTYET__ */
power_off();
serial_writestr_P(PSTR("\nstop\n"));
break;
@ -466,10 +462,10 @@ void process_gcode_command() {
//? --- M101: extruder on ---
//?
//? Undocumented.
#ifndef __ARMEL_NOTYET__
if (temp_achieved() == 0) {
enqueue(NULL);
}
#ifndef __ARMEL_NOTYET__
#ifdef DC_EXTRUDER
heater_set(DC_EXTRUDER, DC_EXTRUDER_PWM);
#endif
@ -505,7 +501,6 @@ void process_gcode_command() {
//?
if ( ! next_target.seen_S)
break;
#ifndef __ARMEL_NOTYET__
if ( ! next_target.seen_P)
#ifdef HEATER_EXTRUDER
next_target.P = HEATER_EXTRUDER;
@ -513,7 +508,6 @@ void process_gcode_command() {
next_target.P = 0;
#endif
temp_set(next_target.P, next_target.S);
#endif /* __ARMEL_NOTYET__ */
break;
case 105:
@ -533,11 +527,9 @@ void process_gcode_command() {
#ifdef ENFORCE_ORDER
queue_wait();
#endif
#ifndef __ARMEL_NOTYET__
if ( ! next_target.seen_P)
next_target.P = TEMP_SENSOR_none;
temp_print(next_target.P);
#endif /* __ARMEL_NOTYET__ */
break;
case 7:
@ -820,9 +812,7 @@ void process_gcode_command() {
#ifdef HEATER_BED
if ( ! next_target.seen_S)
break;
#ifndef __ARMEL_NOTYET__
temp_set(HEATER_BED, next_target.S);
#endif /* __ARMEL_NOTYET__ */
#endif
break;

View File

@ -34,8 +34,8 @@
#include "dda_queue.h"
#include "gcode_parse.h"
#include "timer.h"
#ifndef __ARMEL_NOTYET__
#include "temp.h"
#ifndef __ARMEL_NOTYET__
#include "watchdog.h"
#include "debug.h"
#include "heater.h"
@ -109,10 +109,10 @@ void init(void) {
// if any of the temp sensors in your config.h use analog interface
analog_init();
#ifndef __ARMEL_NOTYET__
// set up temperature inputs
temp_init();
#ifndef __ARMEL_NOTYET__
#ifdef SD
sd_init();
#endif

2
temp.c
View File

@ -297,7 +297,9 @@ void temp_sensor_tick() {
}
if (temp_sensors[i].heater < NUM_HEATERS) {
#ifndef __ARMEL_NOTYET__
heater_tick(temp_sensors[i].heater, temp_sensors[i].temp_type, temp_sensors_runtime[i].last_read_temp, temp_sensors_runtime[i].target_temp);
#endif /* __ARMEL_NOTYET__ */
}
if (DEBUG_PID && (debug_flags & DEBUG_PID))