Fix build and make sm4 a C++ file
This commit is contained in:
parent
a2d45e5d11
commit
aa8569600c
|
|
@ -252,7 +252,7 @@ set(FW_SOURCES
|
||||||
SdFatUtil.cpp
|
SdFatUtil.cpp
|
||||||
SdFile.cpp
|
SdFile.cpp
|
||||||
SdVolume.cpp
|
SdVolume.cpp
|
||||||
sm4.c
|
sm4.cpp
|
||||||
sound.cpp
|
sound.cpp
|
||||||
speed_lookuptable.cpp
|
speed_lookuptable.cpp
|
||||||
spi.c
|
spi.c
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
//sm4.c - simple 4-axis stepper control
|
//sm4.cpp - simple 4-axis stepper control
|
||||||
|
|
||||||
#include "sm4.h"
|
#include "sm4.h"
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
|
@ -70,7 +69,7 @@ void sm4_set_dir(uint8_t axis, uint8_t dir)
|
||||||
|
|
||||||
void sm4_set_dir_bits(uint8_t dir_bits)
|
void sm4_set_dir_bits(uint8_t dir_bits)
|
||||||
{
|
{
|
||||||
register uint8_t portL = PORTL;
|
uint8_t portL = PORTL;
|
||||||
portL &= 0xb8; //set direction bits to zero
|
portL &= 0xb8; //set direction bits to zero
|
||||||
//TODO -optimize in asm
|
//TODO -optimize in asm
|
||||||
#if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
|
#if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
|
||||||
|
|
@ -96,7 +95,7 @@ void sm4_do_step(uint8_t axes_mask)
|
||||||
#ifdef TMC2130_DEDGE_STEPPING
|
#ifdef TMC2130_DEDGE_STEPPING
|
||||||
PINC = (axes_mask & 0x0f); // toggle step signals by mask
|
PINC = (axes_mask & 0x0f); // toggle step signals by mask
|
||||||
#else
|
#else
|
||||||
register uint8_t portC = PORTC & 0xf0;
|
uint8_t portC = PORTC & 0xf0;
|
||||||
PORTC = portC | (axes_mask & 0x0f); //set step signals by mask
|
PORTC = portC | (axes_mask & 0x0f); //set step signals by mask
|
||||||
asm("nop");
|
asm("nop");
|
||||||
PORTC = portC; //set step signals to zero
|
PORTC = portC; //set step signals to zero
|
||||||
|
|
@ -5,12 +5,6 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif //defined(__cplusplus)
|
|
||||||
|
|
||||||
|
|
||||||
// callback prototype for stop condition (return 0 - continue, return 1 - stop)
|
// callback prototype for stop condition (return 0 - continue, return 1 - stop)
|
||||||
typedef uint8_t (*sm4_stop_cb_t)();
|
typedef uint8_t (*sm4_stop_cb_t)();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue