[Grbl_Esp32 Issue#21] Problems compiling due to function not returning a value

未分类 bolang 4个月前 (10-14) 55次浏览

Issue #21 | 状态: 已关闭 | 作者: paqwalsh | 创建时间: 2018-08-18

标签: bug


Hi, thanks for putting this port of GRBL up on Github. I found that after downloading and trying to compile there was an error that cancelled the compile process. I think it was due to a warning in a uint8_t function which was not returning a value.

Just wanted to share that by adding the return statement to the function in spindle_control.cpp allowed it to compile so have it running on ESP32 now. I hope to wire something up to test it out over the next week or two.

uint8t spindleget_state()
{
return 0;
}

Thanks again for sharing. Nice Port.


评论 (2)

#1 – bdring 于 2018-08-18

Thanks!

Weird…it compiles for me.

Regardless, that is a mistake. It should return something. I don’t support spindle direction or spindle enable yet, so I just ignored that function. I’ll get that fixed soon.


#2 – bdring 于 2018-08-19

I updated the code to return the correct values.


if (ledcRead(SPINDLEPWMCHANNEL) == 0) // Check the PWM value
return(SPINDLESTATEDISABLE);
else
return(SPINDLESTATECW); // only CW is supported right now.


原始Issue: https://github.com/bdring/Grbl_Esp32/issues/21

喜欢 (0)