Skip to content

Change to NAN flag for no rotary axis #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions display/i2c_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <stdio.h>
#include <string.h>
#include <math.h>

#include "i2c_interface.h"

Expand Down Expand Up @@ -68,7 +69,7 @@ static machine_status_packet_t status_packet, prev_status = {0};

static void send_status_info (void *data)
{
uint_fast8_t idx = min(4, N_AXIS);
uint_fast8_t idx = N_AXIS; //min(4, N_AXIS);

system_convert_array_steps_to_mpos(status_packet.coordinate.values, sys.position);

Expand Down Expand Up @@ -97,7 +98,7 @@ static void send_status_info (void *data)

status_packet.feed_rate = st_get_realtime_rate();

if(msgtype || memcmp(&prev_status, &status_packet, offsetof(machine_status_packet_t, msgtype))) {
if(true) {//msgtype || memcmp(&prev_status, &status_packet, offsetof(machine_status_packet_t, msgtype))) {
Copy link
Contributor Author

@engigeer engigeer May 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to get your thoughts on this change to ensure the status message is sent even if the status_packet is unchanged. The rationale is that some commands from the controller do not change the status packet, (e.g., macro keys), but the controller firmware expects a response packet after each keypress.


size_t len = ((status_packet.msgtype = msgtype)) ? offsetof(machine_status_packet_t, msg) : offsetof(machine_status_packet_t, msgtype);

Expand Down Expand Up @@ -440,7 +441,7 @@ void display_init (void)

status_packet.address = 0;
#if N_AXIS == 3
status_packet.coordinate.a = 0xFFFFFFFF; // TODO: should be changed to NAN
status_packet.coordinate.a = NAN; // TODO: should be changed to NAN
#endif

// delay final setup until startup is complete
Expand Down