Open jeffm852 opened 8 years ago
+1
@jeffm852 , Would you like to collaborate on this?
If yes, please see my comments on issue grbl#628 (https://github.com/grbl/grbl/issues/628).
I have partially working status led code, but I am having trouble getting it to fully work. Any help would be appreciated.
After much tinkering with the code i seem to have solved my own issue. In the end I had to get rid of the macro that was programmed in the example code. It also didn't hurt to learn a tiny bit about bit setting in C / C# programming. I'm still not a great programmer by any means, but I'm slightly better now. In the end the KISS method helped to simplify the code to where I both understood what the code was doing within the state machine AND worked as expected.
So... go me! Yay! :)
here is the working simplified code:
for cpu_map.h file:
// Define flood and mist coolant enable output pins.
//#define COOLANT_MIST_DDR DDRC //#define COOLANT_MIST_PORT PORTC //#define COOLANT_MIST_BIT 4 // Uno Analog Pin 4
////////////////// // Define ALARM LED OUTPUT
//////////////////
and for protocol.c file:
// Executes run-time commands, when required. This function primarily operates as Grbl's state // machine and controls the various real-time features Grbl has to offer. // NOTE: Do not alter this unless you know exactly what you are doing! void protocol_exec_rt_system() {
uint8_t rt_exec; // Temp variable to avoid calling volatile multiple times. rt_exec = sys_rt_exec_alarm; // Copy volatile sys_rt_exec_alarm.
/////////////////////// // Define ALARM LED OUTPUT signal_light_init; //init LED in off state if (sys.state==STATE_ALARM) {signal_light_on;} else if (sys.state!=STATE_ALARM) {signal_light_off;} // else {signal_light_off;} ///////////////////////
see https://github.com/grbl/grbl/issues/628