Prusa MINI Firmware overview
marlin_client.h File Reference
#include "marlin_events.h"
#include "marlin_vars.h"
#include "marlin_errors.h"
#include "marlin_host.h"

Go to the source code of this file.

Macros

#define MARLIN_CFLG_STARTED   0x0001
 
#define MARLIN_CFLG_PROCESS   0x0002
 
#define MARLIN_CFLG_BUSY   0x0004
 
#define MARLIN_CFLG_LOWHIGH   0x0008
 
#define MARLIN_CFLG_MESSAGE   0x0010
 

Functions

int marlin_all_axes_homed (void)
 
int marlin_all_axes_known (void)
 
marlin_vars_tmarlin_client_init (void)
 
void marlin_client_shdn (void)
 
void marlin_client_loop (void)
 
int marlin_processing (void)
 
int marlin_busy (void)
 
uint32_t marlin_command (void)
 
void marlin_start_processing (void)
 
void marlin_stop_processing (void)
 
int marlin_motion (void)
 
int marlin_wait_motion (uint32_t timeout)
 
void marlin_gcode (const char *gcode)
 
int marlin_gcode_printf (const char *format,...)
 
void marlin_gcode_push_front (const char *gcode)
 
int marlin_event (uint8_t evt_id)
 
int marlin_event_set (uint8_t evt_id)
 
int marlin_event_clr (uint8_t evt_id)
 
uint64_t marlin_events (void)
 
int marlin_change (uint8_t var_id)
 
int marlin_change_set (uint8_t var_id)
 
int marlin_change_clr (uint8_t var_id)
 
uint64_t marlin_changes (void)
 
int marlin_error (uint8_t err_id)
 
int marlin_error_set (uint8_t err_id)
 
int marlin_error_clr (uint8_t err_id)
 
uint64_t marlin_errors (void)
 
variant8_t marlin_get_var (uint8_t var_id)
 
variant8_t marlin_set_var (uint8_t var_id, variant8_t val)
 
marlin_vars_tmarlin_vars (void)
 
marlin_vars_tmarlin_update_vars (uint64_t msk)
 
uint8_t marlin_get_gqueue (void)
 
uint8_t marlin_get_gqueue_max (void)
 
uint8_t marlin_get_pqueue (void)
 
uint8_t marlin_get_pqueue_max (void)
 
float marlin_set_target_nozzle (float val)
 
float marlin_set_target_bed (float val)
 
float marlin_set_z_offset (float val)
 
uint8_t marlin_set_fan_speed (uint8_t val)
 
uint16_t marlin_set_print_speed (uint16_t val)
 
uint16_t marlin_set_flow_factor (uint16_t val)
 
uint8_t marlin_set_wait_heat (uint8_t val)
 
uint8_t marlin_set_wait_user (uint8_t val)
 
void marlin_do_babysteps_Z (float offs)
 
void marlin_settings_save (void)
 
void marlin_settings_load (void)
 
void marlin_manage_heater (void)
 
void marlin_quick_stop (void)
 
void marlin_print_abort (void)
 
void marlin_print_pause (void)
 
void marlin_print_resume (void)
 
void marlin_park_head (void)
 
uint8_t marlin_message_received (void)
 
host_prompt_type_t marlin_host_prompt_type (void)
 
uint8_t marlin_host_button_count (void)
 
host_prompt_button_t marlin_host_button_type (uint8_t index)
 
void marlin_host_button_click (host_prompt_button_t button)
 
int marlin_reheating (void)
 

Macro Definition Documentation

◆ MARLIN_CFLG_STARTED

#define MARLIN_CFLG_STARTED   0x0001

◆ MARLIN_CFLG_PROCESS

#define MARLIN_CFLG_PROCESS   0x0002

◆ MARLIN_CFLG_BUSY

#define MARLIN_CFLG_BUSY   0x0004

◆ MARLIN_CFLG_LOWHIGH

#define MARLIN_CFLG_LOWHIGH   0x0008

◆ MARLIN_CFLG_MESSAGE

#define MARLIN_CFLG_MESSAGE   0x0010

Function Documentation

◆ marlin_all_axes_homed()

int marlin_all_axes_homed ( void  )
373  {
374  return all_axes_homed() ? 1 : 0;
375 }
Here is the caller graph for this function:

◆ marlin_all_axes_known()

int marlin_all_axes_known ( void  )
377  {
378  return all_axes_known() ? 1 : 0;
379 }
Here is the caller graph for this function:

◆ marlin_client_init()

marlin_vars_t* marlin_client_init ( void  )
84  {
85  int client_id;
86  marlin_client_t *client = 0;
89  for (client_id = 0; client_id < MARLIN_MAX_CLIENTS; client_id++)
90  if (marlin_client_task[client_id] == 0)
91  break;
92  if (client_id < MARLIN_MAX_CLIENTS) {
93  client = marlin_client + client_id;
94  memset(client, 0, sizeof(marlin_client_t));
95  osMessageQDef(clientQueue, 32, uint32_t);
96  marlin_client_queue[client_id] = osMessageCreate(osMessageQ(clientQueue), NULL);
97  client->id = client_id;
98  client->flags = 0;
99  client->events = 0;
100  client->changes = 0;
101  marlin_clients++;
103  client->errors = 0;
104  client->mesh.xc = 4;
105  client->mesh.yc = 4;
106  client->command = MARLIN_CMD_NONE;
107  client->reheating = 0;
108  marlin_client_task[client_id] = osThreadGetId();
109  }
111  return (client) ? &(client->vars) : 0;
112 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_client_shdn()

void marlin_client_shdn ( void  )
114  {
115  //TODO
116 }

◆ marlin_client_loop()

void marlin_client_loop ( void  )
118  {
119  uint16_t count = 0;
120  osEvent ose;
121  variant8_t msg;
122  int client_id;
123  marlin_client_t *client;
125  osThreadId taskHandle = osThreadGetId();
126  for (client_id = 0; client_id < MARLIN_MAX_CLIENTS; client_id++)
127  if (taskHandle == marlin_client_task[client_id])
128  break;
129  if (client_id >= MARLIN_MAX_CLIENTS)
130  return;
131  client = marlin_client + client_id;
132  if ((queue = marlin_client_queue[client_id]) != 0)
133  while ((ose = osMessageGet(queue, 0)).status == osEventMessage) {
134  if (client->flags & MARLIN_CFLG_LOWHIGH) {
135  *(((uint32_t *)(&msg)) + 1) = ose.value.v; //store high dword
136  _process_client_message(client, msg); //call handler
137  count++;
138  } else
139  *(((uint32_t *)(&msg)) + 0) = ose.value.v; //store low dword
140  client->flags ^= MARLIN_CFLG_LOWHIGH; //flip flag
141  }
142  client->last_count = count;
143 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_processing()

int marlin_processing ( void  )
145  {
146  marlin_client_t *client = _client_ptr();
147  if (client)
148  return (client->flags & MARLIN_CFLG_PROCESS) ? 1 : 0;
149  return 0;
150 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_busy()

int marlin_busy ( void  )
152  {
153  marlin_client_t *client = _client_ptr();
154  if (client)
155  return (client->flags & MARLIN_CFLG_BUSY) ? 1 : 0;
156  return 0;
157 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_command()

uint32_t marlin_command ( void  )
159  {
160  marlin_client_t *client = _client_ptr();
161  if (client)
162  return client->command;
163  return MARLIN_CMD_NONE;
164 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_start_processing()

void marlin_start_processing ( void  )
174  {
175  marlin_client_t *client = _client_ptr();
176  if (client == 0)
177  return;
178  _send_request_to_server(client->id, "!start");
179  _wait_ack_from_server(client->id);
180 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_stop_processing()

void marlin_stop_processing ( void  )
166  {
167  marlin_client_t *client = _client_ptr();
168  if (client == 0)
169  return;
170  _send_request_to_server(client->id, "!stop");
171  _wait_ack_from_server(client->id);
172 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_motion()

int marlin_motion ( void  )
182  {
184  return (vars->motion) ? 1 : 0;
185 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_wait_motion()

int marlin_wait_motion ( uint32_t  timeout)
187  {
189  uint32_t tick = HAL_GetTick();
190  while ((vars->motion == 0) && ((HAL_GetTick() - tick) < timeout))
192  return (vars->motion) ? 1 : 0;
193 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_gcode()

void marlin_gcode ( const char *  gcode)
195  {
196  char request[MARLIN_MAX_REQUEST];
197  marlin_client_t *client = _client_ptr();
198  if (client == 0)
199  return;
200  strcpy(request, "!g ");
201  strcat(request, gcode);
202  _send_request_to_server(client->id, request);
203  _wait_ack_from_server(client->id);
204 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_gcode_printf()

int marlin_gcode_printf ( const char *  format,
  ... 
)
206  {
207  int ret;
208  char request[MARLIN_MAX_REQUEST];
209  marlin_client_t *client = _client_ptr();
210  if (client == 0)
211  return 0;
212  strcpy(request, "!g ");
213  va_list ap;
214  va_start(ap, format);
215  ret = vsprintf(request + 3, format, ap);
216  va_end(ap);
217  _send_request_to_server(client->id, request);
218  _wait_ack_from_server(client->id);
219  return ret;
220 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_gcode_push_front()

void marlin_gcode_push_front ( const char *  gcode)
222  {
223  char request[MARLIN_MAX_REQUEST];
224  marlin_client_t *client = _client_ptr();
225  if (client == 0)
226  return;
227  snprintf(request, MARLIN_MAX_REQUEST, "!ig %p", gcode);
228  _send_request_to_server(client->id, request);
229  _wait_ack_from_server(client->id);
230 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_event()

int marlin_event ( uint8_t  evt_id)
232  {
233  int ret = 0;
234  marlin_client_t *client = _client_ptr();
235  uint64_t msk = (uint64_t)1 << evt_id;
236  if (client)
237  ret = (client->events & msk) ? 1 : 0;
238  return ret;
239 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_event_set()

int marlin_event_set ( uint8_t  evt_id)
241  {
242  int ret = 0;
243  marlin_client_t *client = _client_ptr();
244  uint64_t msk = (uint64_t)1 << evt_id;
245  if (client) {
246  ret = (client->events & msk) ? 1 : 0;
247  client->events |= msk;
248  }
249  return ret;
250 }
Here is the call graph for this function:

◆ marlin_event_clr()

int marlin_event_clr ( uint8_t  evt_id)
252  {
253  int ret = 0;
254  marlin_client_t *client = _client_ptr();
255  uint64_t msk = (uint64_t)1 << evt_id;
256  if (client) {
257  ret = (client->events & msk) ? 1 : 0;
258  client->events &= ~msk;
259  }
260  return ret;
261 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_events()

uint64_t marlin_events ( void  )
263  {
264  marlin_client_t *client = _client_ptr();
265  return (client) ? client->events : 0;
266 }
Here is the call graph for this function:

◆ marlin_change()

int marlin_change ( uint8_t  var_id)
268  {
269  int ret = 0;
270  marlin_client_t *client = _client_ptr();
271  uint64_t msk = (uint64_t)1 << var_id;
272  if (client)
273  ret = (client->changes & msk) ? 1 : 0;
274  return ret;
275 }
Here is the call graph for this function:

◆ marlin_change_set()

int marlin_change_set ( uint8_t  var_id)
277  {
278  int ret = 0;
279  marlin_client_t *client = _client_ptr();
280  uint64_t msk = (uint64_t)1 << var_id;
281  if (client) {
282  ret = (client->changes & msk) ? 1 : 0;
283  client->changes |= msk;
284  }
285  return ret;
286 }
Here is the call graph for this function:

◆ marlin_change_clr()

int marlin_change_clr ( uint8_t  var_id)
288  {
289  int ret = 0;
290  marlin_client_t *client = _client_ptr();
291  uint64_t msk = (uint64_t)1 << var_id;
292  if (client) {
293  ret = (client->changes & msk) ? 1 : 0;
294  client->changes &= ~msk;
295  }
296  return ret;
297 }
Here is the call graph for this function:

◆ marlin_changes()

uint64_t marlin_changes ( void  )
299  {
300  marlin_client_t *client = _client_ptr();
301  return (client) ? client->changes : 0;
302 }
Here is the call graph for this function:

◆ marlin_error()

int marlin_error ( uint8_t  err_id)
304  {
305  int ret = 0;
306  marlin_client_t *client = _client_ptr();
307  uint64_t msk = (uint64_t)1 << err_id;
308  if (client)
309  ret = (client->errors & msk) ? 1 : 0;
310  return ret;
311 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_error_set()

int marlin_error_set ( uint8_t  err_id)
313  {
314  int ret = 0;
315  marlin_client_t *client = _client_ptr();
316  uint64_t msk = (uint64_t)1 << err_id;
317  if (client) {
318  ret = (client->errors & msk) ? 1 : 0;
319  client->errors |= msk;
320  }
321  return ret;
322 }
Here is the call graph for this function:

◆ marlin_error_clr()

int marlin_error_clr ( uint8_t  err_id)
324  {
325  int ret = 0;
326  marlin_client_t *client = _client_ptr();
327  uint64_t msk = (uint64_t)1 << err_id;
328  if (client) {
329  ret = (client->errors & msk) ? 1 : 0;
330  client->errors &= ~msk;
331  }
332  return ret;
333 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_errors()

uint64_t marlin_errors ( void  )
335  {
336  marlin_client_t *client = _client_ptr();
337  return (client) ? client->errors : 0;
338 }
Here is the call graph for this function:

◆ marlin_get_var()

variant8_t marlin_get_var ( uint8_t  var_id)
340  {
341  marlin_client_t *client = _client_ptr();
342  return (client) ? marlin_vars_get_var(&(client->vars), var_id) : variant8_empty();
343 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_set_var()

variant8_t marlin_set_var ( uint8_t  var_id,
variant8_t  val 
)
345  {
346  variant8_t retval = variant8_empty();
347  char request[MARLIN_MAX_REQUEST];
348  int n;
349  marlin_client_t *client = _client_ptr();
350  if (client) {
351  retval = marlin_vars_get_var(&(client->vars), var_id);
352  marlin_vars_set_var(&(client->vars), var_id, val);
353  n = sprintf(request, "!var %s ", marlin_vars_get_name(var_id));
354  marlin_vars_value_to_str(&(client->vars), var_id, request + n);
355  _send_request_to_server(client->id, request);
356  _wait_ack_from_server(client->id);
357  }
358  return retval;
359 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_vars()

marlin_vars_t* marlin_vars ( void  )
361  {
362  marlin_client_t *client = _client_ptr();
363  if (client)
364  return &(client->vars);
365  return 0;
366 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_update_vars()

marlin_vars_t* marlin_update_vars ( uint64_t  msk)
368  {
369  char request[MARLIN_MAX_REQUEST];
370  marlin_client_t *client = _client_ptr();
371  if (client == 0)
372  return 0;
374  client->changes &= ~msk;
375  sprintf(request, "!update %" PRIu64, msk);
376  _send_request_to_server(client->id, request);
377  _wait_ack_from_server(client->id);
378  return &(client->vars);
379 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_get_gqueue()

uint8_t marlin_get_gqueue ( void  )
381  {
383 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_get_gqueue_max()

uint8_t marlin_get_gqueue_max ( void  )
385  {
386  //TODO: variable gqueue_max should be part of marlin_consts structure transmited from server
387  //Marlin/queue, BUFSIZE - 1
388  return 8 - 1;
389 }

◆ marlin_get_pqueue()

uint8_t marlin_get_pqueue ( void  )
391  {
393 }
Here is the call graph for this function:

◆ marlin_get_pqueue_max()

uint8_t marlin_get_pqueue_max ( void  )
395  {
396  //TODO: variable pqueue_max should be part of marlin_consts structure transmited from server
397  //Marlin/planner, BLOCK_BUFFER_SIZE - 1
398  return 16 - 1;
399 }

◆ marlin_set_target_nozzle()

float marlin_set_target_nozzle ( float  val)
401  {
403 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_set_target_bed()

float marlin_set_target_bed ( float  val)
405  {
407 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_set_z_offset()

float marlin_set_z_offset ( float  val)
409  {
411 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_set_fan_speed()

uint8_t marlin_set_fan_speed ( uint8_t  val)
413  {
415 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_set_print_speed()

uint16_t marlin_set_print_speed ( uint16_t  val)
417  {
419 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_set_flow_factor()

uint16_t marlin_set_flow_factor ( uint16_t  val)
421  {
423 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_set_wait_heat()

uint8_t marlin_set_wait_heat ( uint8_t  val)
425  {
427 }
Here is the call graph for this function:

◆ marlin_set_wait_user()

uint8_t marlin_set_wait_user ( uint8_t  val)
429  {
431 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_do_babysteps_Z()

void marlin_do_babysteps_Z ( float  offs)
433  {
434  char request[MARLIN_MAX_REQUEST];
435  marlin_client_t *client = _client_ptr();
436  if (client == 0)
437  return;
438  sprintf(request, "!babystep_Z %.4f", (double)offs);
439  _send_request_to_server(client->id, request);
440  _wait_ack_from_server(client->id);
441 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_settings_save()

void marlin_settings_save ( void  )
443  {
444  marlin_client_t *client = _client_ptr();
445  if (client == 0)
446  return;
447  _send_request_to_server(client->id, "!save");
448  _wait_ack_from_server(client->id);
449 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_settings_load()

void marlin_settings_load ( void  )
451  {
452  marlin_client_t *client = _client_ptr();
453  if (client == 0)
454  return;
455  _send_request_to_server(client->id, "!load");
456  _wait_ack_from_server(client->id);
457 }
Here is the call graph for this function:

◆ marlin_manage_heater()

void marlin_manage_heater ( void  )
459  {
460  marlin_client_t *client = _client_ptr();
461  if (client == 0)
462  return;
463  _send_request_to_server(client->id, "!updt");
464  _wait_ack_from_server(client->id);
465 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_quick_stop()

void marlin_quick_stop ( void  )
467  {
468  marlin_client_t *client = _client_ptr();
469  if (client == 0)
470  return;
471  _send_request_to_server(client->id, "!qstop");
472  _wait_ack_from_server(client->id);
473 }
Here is the call graph for this function:

◆ marlin_print_abort()

void marlin_print_abort ( void  )
475  {
476  marlin_client_t *client = _client_ptr();
477  if (client == 0)
478  return;
479  _send_request_to_server(client->id, "!pabort");
480  _wait_ack_from_server(client->id);
481 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_print_pause()

void marlin_print_pause ( void  )
483  {
484  marlin_client_t *client = _client_ptr();
485  if (client == 0)
486  return;
487  _send_request_to_server(client->id, "!ppause");
488  _wait_ack_from_server(client->id);
489 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_print_resume()

void marlin_print_resume ( void  )
491  {
492  marlin_client_t *client = _client_ptr();
493  if (client == 0)
494  return;
495  _send_request_to_server(client->id, "!presume");
496  _wait_ack_from_server(client->id);
497 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_park_head()

void marlin_park_head ( void  )
499  {
500  marlin_client_t *client = _client_ptr();
501  if (client == 0)
502  return;
503  _send_request_to_server(client->id, "!park");
504  _wait_ack_from_server(client->id);
505 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_message_received()

uint8_t marlin_message_received ( void  )
507  {
508  marlin_client_t *client = _client_ptr();
509  if (client == 0)
510  return 0;
511  if (client->flags & MARLIN_CFLG_MESSAGE) {
512  client->flags &= ~MARLIN_CFLG_MESSAGE;
513  return 1;
514  } else
515  return 0;
516 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_host_prompt_type()

host_prompt_type_t marlin_host_prompt_type ( void  )
521  {
522  marlin_client_t *client = _client_ptr();
523  if (client)
524  return client->prompt.type;
525  return HOST_PROMPT_None;
526 }
Here is the call graph for this function:

◆ marlin_host_button_count()

uint8_t marlin_host_button_count ( void  )
528  {
529  marlin_client_t *client = _client_ptr();
530  if (client)
531  return client->prompt.button_count;
532  return 0;
533 }
Here is the call graph for this function:

◆ marlin_host_button_type()

host_prompt_button_t marlin_host_button_type ( uint8_t  index)
535  {
536  marlin_client_t *client = _client_ptr();
537  if (client && (index < client->prompt.button_count))
538  return client->prompt.button[index];
539  return HOST_PROMPT_BTN_None;
540 }
Here is the call graph for this function:

◆ marlin_host_button_click()

void marlin_host_button_click ( host_prompt_button_t  button)
542  {
543  char request[MARLIN_MAX_REQUEST];
544  marlin_client_t *client = _client_ptr();
545  if (client == 0)
546  return;
547  sprintf(request, "!hclick %d", (int)button);
548  _send_request_to_server(client->id, request);
549  _wait_ack_from_server(client->id);
550 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marlin_reheating()

int marlin_reheating ( void  )
553  {
554  marlin_client_t *client = _client_ptr();
555  if (client)
556  return client->reheating;
557  return 0;
558 }
Here is the call graph for this function:
Here is the caller graph for this function:
MARLIN_MAX_CLIENTS
#define MARLIN_MAX_CLIENTS
Definition: config.h:96
_marlin_client_t::flags
uint16_t flags
Definition: marlin_client.c:41
variant8_ui8
variant8_t variant8_ui8(uint8_t ui8)
Definition: variant8.c:18
marlin_vars_get_name
const char * marlin_vars_get_name(uint8_t var_id)
Definition: marlin_vars.c:36
_wait_ack_from_server
uint32_t _wait_ack_from_server(uint8_t client_id)
Definition: marlin_client.c:601
osThreadId
TaskHandle_t osThreadId
Definition: cmsis_os.h:283
osSemaphoreWait
int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t millisec)
Wait until a Semaphore token becomes available.
Definition: cmsis_os.c:822
queue
GCodeQueue queue
Definition: queue.cpp:28
marlin_vars_get_var
variant8_t marlin_vars_get_var(marlin_vars_t *vars, uint8_t var_id)
Definition: marlin_vars.c:50
g29_auto.gcode
list gcode
Definition: g29_auto.py:44
_variant8_t::ui16
uint16_t ui16
Definition: variant8.h:34
MARLIN_VAR_FLOWFACT
#define MARLIN_VAR_FLOWFACT
Definition: marlin_vars.h:26
MARLIN_VAR_MOTION
#define MARLIN_VAR_MOTION
Definition: marlin_vars.h:8
_marlin_host_prompt_t::button
host_prompt_button_t button[HOST_PROMPT_MAX_BUTTONS]
Definition: marlin_host.h:49
_variant8_t::ui8
uint8_t ui8
Definition: variant8.h:36
MARLIN_VAR_FANSPEED
#define MARLIN_VAR_FANSPEED
Definition: marlin_vars.h:24
marlin_get_var
variant8_t marlin_get_var(uint8_t var_id)
Definition: marlin_client.c:340
marlin_vars_value_to_str
void marlin_vars_value_to_str(marlin_vars_t *vars, uint8_t var_id, char *str)
Definition: marlin_vars.c:183
MARLIN_VAR_TTEM_BED
#define MARLIN_VAR_TTEM_BED
Definition: marlin_vars.h:22
_marlin_client_t::reheating
uint8_t reheating
Definition: marlin_client.c:51
_marlin_host_prompt_t::type
host_prompt_type_t type
Definition: marlin_host.h:47
_marlin_client_t::command
uint32_t command
Definition: marlin_client.c:49
_marlin_mesh_t::xc
uint8_t xc
Definition: marlin_events.h:104
marlin_client_loop
void marlin_client_loop(void)
Definition: marlin_client.c:118
osThreadGetId
osThreadId osThreadGetId(void)
Return the thread ID of the current running thread.
Definition: cmsis_os.c:283
NULL
#define NULL
Definition: usbd_def.h:53
marlin_client
marlin_client_t marlin_client[MARLIN_MAX_CLIENTS]
Definition: marlin_client.c:62
osMessageQId
QueueHandle_t osMessageQId
Definition: cmsis_os.h:303
MARLIN_CFLG_LOWHIGH
#define MARLIN_CFLG_LOWHIGH
Definition: marlin_client.h:14
osMessageGet
osEvent osMessageGet(osMessageQId queue_id, uint32_t millisec)
Get a Message or Wait for a Message from a Queue.
Definition: cmsis_os.c:1145
HOST_PROMPT_None
Definition: marlin_host.h:18
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
variant8_ui16
variant8_t variant8_ui16(uint16_t ui16)
Definition: variant8.c:30
all_axes_known
FORCE_INLINE bool all_axes_known()
Definition: motion.h:45
MARLIN_VAR_WAITUSER
#define MARLIN_VAR_WAITUSER
Definition: marlin_vars.h:28
osEvent
Definition: cmsis_os.h:395
_variant8_t
Definition: variant8.h:24
HOST_PROMPT_BTN_None
Definition: marlin_host.h:26
_variant8_t::flt
float flt
Definition: variant8.h:31
marlin_set_var
variant8_t marlin_set_var(uint8_t var_id, variant8_t val)
Definition: marlin_client.c:345
_marlin_host_prompt_t::button_count
uint8_t button_count
Definition: marlin_host.h:48
MARLIN_MAX_REQUEST
#define MARLIN_MAX_REQUEST
Definition: config.h:97
_marlin_client_t
Definition: marlin_client.c:39
MARLIN_VAR_PQUEUE
#define MARLIN_VAR_PQUEUE
Definition: marlin_vars.h:10
_process_client_message
void _process_client_message(marlin_client_t *client, variant8_t msg)
Definition: marlin_client.c:612
marlin_client_task
osThreadId marlin_client_task[MARLIN_MAX_CLIENTS]
Definition: marlin_client.c:59
MARLIN_VAR_GQUEUE
#define MARLIN_VAR_GQUEUE
Definition: marlin_vars.h:9
osEventMessage
function completed; message event occurred.
Definition: cmsis_os.h:237
MARLIN_VAR_WAITHEAT
#define MARLIN_VAR_WAITHEAT
Definition: marlin_vars.h:27
marlin_vars_set_var
void marlin_vars_set_var(marlin_vars_t *vars, uint8_t var_id, variant8_t var)
Definition: marlin_vars.c:105
MARLIN_CFLG_STARTED
#define MARLIN_CFLG_STARTED
Definition: marlin_client.h:11
_client_ptr
marlin_client_t * _client_ptr(void)
Definition: marlin_client.c:703
_marlin_client_t::events
uint64_t events
Definition: marlin_client.c:42
osWaitForever
#define osWaitForever
wait forever timeout value
Definition: cmsis_os.h:230
MARLIN_CFLG_BUSY
#define MARLIN_CFLG_BUSY
Definition: marlin_client.h:13
_marlin_client_t::errors
uint64_t errors
Definition: marlin_client.c:47
marlin_update_vars
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
variant8_empty
variant8_t variant8_empty(void)
Definition: variant8.c:10
MARLIN_VAR_MSK
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
_marlin_client_t::prompt
marlin_host_prompt_t prompt
Definition: marlin_client.c:50
MARLIN_VAR_PRNSPEED
#define MARLIN_VAR_PRNSPEED
Definition: marlin_vars.h:25
_send_request_to_server
void _send_request_to_server(uint8_t client_id, const char *request)
Definition: marlin_client.c:570
_marlin_client_t::changes
uint64_t changes
Definition: marlin_client.c:43
_marlin_mesh_t::yc
uint8_t yc
Definition: marlin_events.h:105
marlin_server_sema
osSemaphoreId marlin_server_sema
Definition: marlin_server.cpp:90
_marlin_client_t::id
uint8_t id
Definition: marlin_client.c:40
status
static status_t status
Definition: filament_sensor.c:37
_marlin_client_t::vars
marlin_vars_t vars
Definition: marlin_client.c:44
marlin_clients
uint8_t marlin_clients
Definition: marlin_client.c:63
_marlin_vars_t
Definition: marlin_vars.h:77
_wait_server_started
void _wait_server_started(void)
Definition: marlin_client.c:564
osMessageCreate
osMessageQId osMessageCreate(const osMessageQDef_t *queue_def, osThreadId thread_id)
Create and Initialize a Message Queue.
Definition: cmsis_os.c:1086
osMessageQ
#define osMessageQ(name)
Access a Message Queue Definition.
Definition: cmsis_os.h:829
MARLIN_CMD_NONE
#define MARLIN_CMD_NONE
Definition: marlin_events.h:50
MARLIN_CFLG_MESSAGE
#define MARLIN_CFLG_MESSAGE
Definition: marlin_client.h:15
MARLIN_VAR_TTEM_NOZ
#define MARLIN_VAR_TTEM_NOZ
Definition: marlin_vars.h:21
osEvent::value
union osEvent::@54 value
event value
variant8_flt
variant8_t variant8_flt(float flt)
Definition: variant8.c:48
MARLIN_CFLG_PROCESS
#define MARLIN_CFLG_PROCESS
Definition: marlin_client.h:12
_marlin_client_t::last_count
uint16_t last_count
Definition: marlin_client.c:46
osEvent::v
uint32_t v
message as 32-bit value
Definition: cmsis_os.h:398
_marlin_client_t::mesh
marlin_mesh_t mesh
Definition: marlin_client.c:48
marlin_client_queue
osMessageQId marlin_client_queue[MARLIN_MAX_CLIENTS]
Definition: marlin_client.c:60
MARLIN_VAR_Z_OFFSET
#define MARLIN_VAR_Z_OFFSET
Definition: marlin_vars.h:23
_marlin_vars_t::motion
uint8_t motion
Definition: marlin_vars.h:78
osSemaphoreRelease
osStatus osSemaphoreRelease(osSemaphoreId semaphore_id)
Release a Semaphore token.
Definition: cmsis_os.c:862
all_axes_homed
FORCE_INLINE bool all_axes_homed()
Definition: motion.h:44
osMessageQDef
#define osMessageQDef(name, queue_sz, type)
Create a Message Queue Definition.
Definition: cmsis_os.h:818