ARM: get spi.c, pff.c and pff_diskio.c (SD card handling) in.
Neither is ported for now, but also not essential for printing, so it's just made sure it's always disabled on ARM.
This commit is contained in:
parent
d2fcc57ed4
commit
fb317fef08
|
|
@ -100,11 +100,11 @@ TARGET = $(PROGRAM).hex
|
||||||
SOURCES = mendel.c cpu.c serial.c sermsg.c sersendf.c delay.c
|
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 += 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 += dda_queue.c dda_maths.c dda_kinematics.c dda.c dda_lookahead.c
|
||||||
SOURCES += analog.c temp.c heater.c home.c debug.c crc.c
|
SOURCES += analog.c temp.c heater.c home.c debug.c crc.c pff.c pff_diskio.c
|
||||||
SOURCES += intercom.c graycode.c
|
SOURCES += spi.c intercom.c graycode.c
|
||||||
# Sources left:
|
# Sources left:
|
||||||
# spi.c usb_serial.c
|
# usb_serial.c
|
||||||
# pff.c watchdog.c pff_diskio.c
|
# watchdog.c
|
||||||
|
|
||||||
ifeq ($(MCU), lpc1114)
|
ifeq ($(MCU), lpc1114)
|
||||||
SOURCES += cmsis-system_lpc11xx.c
|
SOURCES += cmsis-system_lpc11xx.c
|
||||||
|
|
|
||||||
|
|
@ -374,7 +374,6 @@ void process_gcode_command() {
|
||||||
tool = next_tool;
|
tool = next_tool;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
#ifdef SD
|
#ifdef SD
|
||||||
case 20:
|
case 20:
|
||||||
//? --- M20: list SD card. ---
|
//? --- M20: list SD card. ---
|
||||||
|
|
@ -423,7 +422,6 @@ void process_gcode_command() {
|
||||||
gcode_sources &= ! GCODE_SOURCE_SD;
|
gcode_sources &= ! GCODE_SOURCE_SD;
|
||||||
break;
|
break;
|
||||||
#endif /* SD */
|
#endif /* SD */
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
case 82:
|
case 82:
|
||||||
//? --- M82 - Set E codes absolute ---
|
//? --- M82 - Set E codes absolute ---
|
||||||
|
|
|
||||||
16
mendel.c
16
mendel.c
|
|
@ -35,16 +35,13 @@
|
||||||
#include "gcode_parse.h"
|
#include "gcode_parse.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "temp.h"
|
#include "temp.h"
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "heater.h"
|
#include "heater.h"
|
||||||
#include "analog.h"
|
#include "analog.h"
|
||||||
#include "pinio.h"
|
#include "pinio.h"
|
||||||
#include "clock.h"
|
#include "clock.h"
|
||||||
#include "intercom.h"
|
#include "intercom.h"
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include "sd.h"
|
#include "sd.h"
|
||||||
#include "simulator.h"
|
#include "simulator.h"
|
||||||
|
|
@ -59,6 +56,7 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
#ifdef CANNED_CYCLE
|
#ifdef CANNED_CYCLE
|
||||||
const char PROGMEM canned_gcode_P[] = CANNED_CYCLE;
|
const char PROGMEM canned_gcode_P[] = CANNED_CYCLE;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -74,10 +72,8 @@ void init(void) {
|
||||||
|
|
||||||
cpu_init();
|
cpu_init();
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
// set up watchdog
|
// set up watchdog
|
||||||
wd_init();
|
wd_init();
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
// set up serial
|
// set up serial
|
||||||
serial_init();
|
serial_init();
|
||||||
|
|
@ -88,11 +84,9 @@ void init(void) {
|
||||||
// set up inputs and outputs
|
// set up inputs and outputs
|
||||||
pinio_init();
|
pinio_init();
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
#ifdef SPI
|
||||||
#if defined SPI
|
|
||||||
spi_init();
|
spi_init();
|
||||||
#endif
|
#endif
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
// set up timers
|
// set up timers
|
||||||
timer_init();
|
timer_init();
|
||||||
|
|
@ -109,19 +103,15 @@ void init(void) {
|
||||||
// set up temperature inputs
|
// set up temperature inputs
|
||||||
temp_init();
|
temp_init();
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
#ifdef SD
|
#ifdef SD
|
||||||
sd_init();
|
sd_init();
|
||||||
#endif
|
#endif
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
// enable interrupts
|
// enable interrupts
|
||||||
sei();
|
sei();
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
// reset watchdog
|
// reset watchdog
|
||||||
wd_reset();
|
wd_reset();
|
||||||
#endif /* __ARMEL_NOTYET__ */
|
|
||||||
|
|
||||||
// prepare the power supply
|
// prepare the power supply
|
||||||
power_init();
|
power_init();
|
||||||
|
|
@ -180,7 +170,6 @@ int main (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __ARMEL_NOTYET__
|
|
||||||
#ifdef SD
|
#ifdef SD
|
||||||
if (( ! gcode_active || gcode_active & GCODE_SOURCE_SD) &&
|
if (( ! gcode_active || gcode_active & GCODE_SOURCE_SD) &&
|
||||||
gcode_sources & GCODE_SOURCE_SD) {
|
gcode_sources & GCODE_SOURCE_SD) {
|
||||||
|
|
@ -193,6 +182,7 @@ int main (void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ARMEL_NOTYET__
|
||||||
#ifdef CANNED_CYCLE
|
#ifdef CANNED_CYCLE
|
||||||
/**
|
/**
|
||||||
WARNING!
|
WARNING!
|
||||||
|
|
|
||||||
7
sd.h
7
sd.h
|
|
@ -14,6 +14,13 @@
|
||||||
|
|
||||||
// Feature set of Petit FatFs is currently defined early in pff_conf.h.
|
// Feature set of Petit FatFs is currently defined early in pff_conf.h.
|
||||||
|
|
||||||
|
/**
|
||||||
|
Test configuration.
|
||||||
|
*/
|
||||||
|
#ifdef __ARMEL__
|
||||||
|
#error SD card (SD_CARD_SELECT_PIN) not yet supported on ARM.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void sd_init(void);
|
void sd_init(void);
|
||||||
|
|
||||||
|
|
|
||||||
2
spi.c
2
spi.c
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#ifdef SPI
|
#ifdef SPI
|
||||||
|
|
||||||
/** Initialise serial subsystem.
|
/** Initialise SPI subsystem.
|
||||||
|
|
||||||
Code copied from ATmega164/324/644/1284 data sheet, section 18.2, page 160,
|
Code copied from ATmega164/324/644/1284 data sheet, section 18.2, page 160,
|
||||||
or moved here from mendel.c.
|
or moved here from mendel.c.
|
||||||
|
|
|
||||||
8
spi.h
8
spi.h
|
|
@ -7,10 +7,16 @@
|
||||||
|
|
||||||
#ifdef SPI
|
#ifdef SPI
|
||||||
|
|
||||||
|
/**
|
||||||
|
Test configuration.
|
||||||
|
*/
|
||||||
|
#ifdef __ARMEL__
|
||||||
|
#error SPI (SD_CARD_SELECT_PIN, TEMP_MAX6675) not yet supported on ARM.
|
||||||
|
#endif
|
||||||
|
|
||||||
// Uncomment this to double SPI frequency from (F_CPU / 4) to (F_CPU / 2).
|
// Uncomment this to double SPI frequency from (F_CPU / 4) to (F_CPU / 2).
|
||||||
//#define SPI_2X
|
//#define SPI_2X
|
||||||
|
|
||||||
|
|
||||||
/** Initialise SPI subsystem.
|
/** Initialise SPI subsystem.
|
||||||
*/
|
*/
|
||||||
void spi_init(void);
|
void spi_init(void);
|
||||||
|
|
|
||||||
6
temp.c
6
temp.c
|
|
@ -20,11 +20,17 @@
|
||||||
#include "simulator.h"
|
#include "simulator.h"
|
||||||
|
|
||||||
#ifdef TEMP_INTERCOM
|
#ifdef TEMP_INTERCOM
|
||||||
|
#ifdef __ARMEL__
|
||||||
|
#error TEMP_INTERCOM not yet supported on ARM.
|
||||||
|
#endif
|
||||||
#include "intercom.h"
|
#include "intercom.h"
|
||||||
#include "pinio.h"
|
#include "pinio.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TEMP_MAX6675
|
#ifdef TEMP_MAX6675
|
||||||
|
#ifdef __ARMEL__
|
||||||
|
#error MAX6675 sensors (TEMP_MAX6675) not yet supported on ARM.
|
||||||
|
#endif
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue