bool READ(pin_t pin) { sim_assert(pin < PIN_NB, "READ: Pin number out of range"); // Add any necessary reactive pin-handlers here. return state[pin]; }
struct file *alloc_file(struct path *path, fmode_t mode, const struct file_operations *fop) { sim_assert (false); return 0; }
void fd_install(unsigned int fd, struct file *file) { sim_assert (false); }
void _WRITE(pin_t pin, bool s) { bool old_state = state[pin]; uint64_t nseconds = sim_runtime_ns(); sim_assert(pin < PIN_NB, "WRITE: Pin number out of range"); if (direction[pin] == out) { state[pin] = s; } if (old_state != s) { record_pin(TRACE_PINS + pin, s, nseconds); #ifdef TRACE_ALL_PINS fgreen(); for (int i = 0; i < PIN_NB; i++) { if (state[i]) bred(); else bblack(); fputc('A' + i, stdout); } fbreset(); printf("\n"); #else bred(); if (s) sim_tick('A' + pin); else sim_tick('a' + pin); fbreset(); #endif } if (s && !old_state) { /* rising edge */ int axis = AXIS_NONE; int dir; switch (pin) { case X_STEP_PIN: dir = state[X_DIR_PIN] ? 1 : -1; #ifdef X_INVERT_DIR dir = -dir; #endif axis = X_AXIS; break; case Y_STEP_PIN: dir = state[Y_DIR_PIN] ? 1 : -1; #ifdef Y_INVERT_DIR dir = -dir; #endif axis = Y_AXIS; break; case Z_STEP_PIN: dir = state[Z_DIR_PIN] ? 1 : -1; #ifdef Z_INVERT_DIR dir = -dir; #endif axis = Z_AXIS; break; case E_STEP_PIN: dir = state[E_DIR_PIN] ? 1 : -1; #ifdef E_INVERT_DIR dir = -dir; #endif axis = E_AXIS; break; default: break; } switch ( axis ) { #ifdef KINEMATICS_COREXY case X_AXIS: pos[X_AXIS] += dir; pos[Y_AXIS] += dir; break; case Y_AXIS: pos[X_AXIS] += dir; pos[Y_AXIS] -= dir; break; #endif case Z_AXIS: case E_AXIS: default: pos[axis] += 2 * dir; break; case AXIS_NONE: break; } if ( axis != AXIS_NONE ) { for (int a = X_AXIS; a <= E_AXIS; a++) record_pin(TRACE_POS + axis, pos[axis] / 2, nseconds); static uint64_t prev_ns = -1; if (prev_ns != nseconds) print_pos(); prev_ns = nseconds; for (int a = X_AXIS; a < E_AXIS; a++) sim_endstop(a); } } }
void generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf) { sim_assert (false); return; }
/* * Handle writeback of dirty data for the device backed by this bdi. Also * wakes up periodically and does kupdated style flushing. */ int bdi_writeback_thread(void *data) { sim_assert (false); return 0; }
pid_t f_getown(struct file *filp) { sim_assert (false); return 0; }
void generic_pipe_buf_unmap(struct pipe_inode_info *pipe, struct pipe_buffer *buf, void *address) { sim_assert (false); }
struct dentry * d_alloc(struct dentry *entry, const struct qstr *str) { sim_assert (false); return 0; }
char *dynamic_dname(struct dentry *dentry, char *buffer, int buflen, const char *fmt, ...) { sim_assert (false); return 0; }
void fput(struct file *file) { sim_assert (false); }
struct file *fget_light(unsigned int fd, int *fput_needed) { sim_assert (false); return 0; }
struct file *fget(unsigned int fd) { sim_assert (false); return 0; }
ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out, loff_t *poff, size_t len, unsigned int flags) { sim_assert (false); return 0; }
int f_setown(struct file *filp, unsigned long arg, int force) { sim_assert (false); return 0; }
void *generic_pipe_buf_map(struct pipe_inode_info *pipe, struct pipe_buffer *buf, int atomic) { sim_assert (false); return 0; }
void kill_fasync(struct fasync_struct **fs, int a, int b) { sim_assert (false); }
int generic_pipe_buf_confirm(struct pipe_inode_info *pipe, struct pipe_buffer *buf) { sim_assert (false); return 0; }
int fasync_helper(int a, struct file *file, int b, struct fasync_struct **c) { sim_assert (false); return 0; }
int proc_nr_dentry(ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { sim_assert (false); return 0; }
long sys_close(unsigned int fd) { sim_assert (false); return 0; }
int alloc_fd(unsigned start, unsigned flags) { sim_assert (false); return 0; }
ssize_t splice_to_pipe(struct pipe_inode_info *info, struct splice_pipe_desc *desc) { sim_assert (false); return 0; }
void serial_init(void) { sim_assert(g_argc >= 2, "please specify a serial port device name or gcode file to process"); open_file(); serial_initialised = true; }
int splice_grow_spd(const struct pipe_inode_info *info, struct splice_pipe_desc *desc) { sim_assert (false); return 0; }
void _SET_INPUT(pin_t pin) { sim_assert(pin < PIN_NB, "Pin number out of range"); direction[pin] = in; }
void splice_shrink_spd(struct splice_pipe_desc *desc) { sim_assert (false); }
void SET_OUTPUT(pin_t pin) { sim_assert(pin < PIN_NB, "Pin number out of range"); direction[pin] = out; }
void put_unused_fd(unsigned int fd) { sim_assert (false); }