MakerLab创客实验室 — Let's Make something.
现在注册
已注册用户请 登入
MakerLab创客实验室 — Let's Make something.
现在注册
已注册用户请 登入
evesky large avatar

evesky

MakerLab创客实验室 第 1399 号会员, 加入于 2015-06-04 09:50:55 AM
evesky 收藏的学习
evesky 收藏的话题
evesky 最近创建的学习教程
evesky 最近创建的话题
Marlin固件里是如何产生脉冲控制步进电机加减速的??
固件   •   3 年前   •   最后回复来自 Andy
9
evesky 最近的回复
2 年前
回复了 anstxfw 创建的话题 Marlin固件一些问题
同问啊
@Andy 我不懂汇编,谢谢啦。这个函数的功能就是charIn1与intIn2相乘然后右移16对吗?
在stepper.cpp里有
3 年前
回复了 飘落的叶子 创建的话题 马林固件问题
我也发现这个问题了 请问你解决了吗
@Andy 我想把marlin里的步进电机控制 先移植出来控制一个步进电机,并且加上位置反馈,这样可行性大吗


@Andy
Arduino:1.7.4 (Windows 7), 板:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from sketch_aug07a_ISR.ino:2:0:


```c

sketch_aug07a_ISR.ino: In function 'void __vector_17()':

fastio.h:45:36: error: 'DIOPUL_RPORT' was not declared in this scope

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

fastio.h:33:42: error: 'CRITICAL_SECTION_START' was not declared in this scope

CRITICAL_SECTION_START; \

^

fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

fastio.h:34:43: error: 'DIOPUL_WPORT' was not declared in this scope

{DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); }\

^

fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

In file included from sketch_aug07a_ISR.ino:2:0:

fastio.h:34:72: error: 'DIOPUL_PIN' was not declared in this scope

{DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); }\

^

fastio.h:17:26: note: in definition of macro 'MASK'

#define MASK(PIN) (1 << PIN)

^

fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

In file included from sketch_aug07a_ISR.ino:2:0:

fastio.h:35:42: error: 'CRITICAL_SECTION_END' was not declared in this scope

CRITICAL_SECTION_END; \

^

fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

fastio.h:38:42: error: 'CRITICAL_SECTION_START' was not declared in this scope

CRITICAL_SECTION_START; \

^

fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

fastio.h:39:43: error: 'DIOPUL_WPORT' was not declared in this scope

{DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }\

^

fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

In file included from sketch_aug07a_ISR.ino:2:0:

fastio.h:39:73: error: 'DIOPUL_PIN' was not declared in this scope

{DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }\

^

fastio.h:17:26: note: in definition of macro 'MASK'

#define MASK(PIN) (1 << PIN)

^

fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

In file included from sketch_aug07a_ISR.ino:2:0:

fastio.h:40:42: error: 'CRITICAL_SECTION_END' was not declared in this scope

CRITICAL_SECTION_END; \

^

fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

In file included from sketch_aug07a_ISR.ino:2:0:

fastio.h:30:40: error: 'DIOPUL_WPORT' was not declared in this scope

#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)

^

fastio.h:45:105: note: in expansion of macro '_WRITE_NC'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

fastio.h:30:69: error: 'DIOPUL_PIN' was not declared in this scope

#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)

^

fastio.h:17:26: note: in definition of macro 'MASK'

#define MASK(PIN) (1 << PIN)

^

fastio.h:45:105: note: in expansion of macro '_WRITE_NC'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

fastio.h:30:97: error: 'DIOPUL_WPORT' was not declared in this scope

#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)

^

fastio.h:45:105: note: in expansion of macro '_WRITE_NC'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'

fastio.h:30:127: error: 'DIOPUL_PIN' was not declared in this scope

#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)

^

fastio.h:17:26: note: in definition of macro 'MASK'

#define MASK(PIN) (1 << PIN)

^

fastio.h:45:105: note: in expansion of macro '_WRITE_NC'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^


fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch_aug07a_ISR.ino:73:3: note: in expansion of macro 'WRITE'
```

编译有误。

报告将会包含更多的信息
"在编译时,输出详细信息"
在 文件>首选项 中启用
@Andy WRITE(Pin,HIGH);WRITE(Pin,LOW)这两个语句不会因为时间太短而不被识别吗? 还有就是 我把marlin的fastio.h和pins.h都加入到我的程序里了 为什么 我只要写WRITE();,程序就会报错呢
@Andy 能帮我一下吗 帮我指出marlin固件是如何中断产生脉冲 周期如何改变的 谢谢了
@Andy 你好 我想把中断产生脉冲提取出来,用到控制一个步进电机上,我还是不能确定是哪一部分产生脉冲,能帮帮我吗