Skip to content

Commit 5071822

Browse files
committed
Updated for core stream changes.
1 parent 4205f4c commit 5071822

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/serial.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ static void uart_interrupt_handler (void);
3939
//
4040
// serialGetC - returns -1 if no data available
4141
//
42-
static int16_t serialGetC (void)
42+
static int32_t serialGetC (void)
4343
{
44-
int16_t data;
44+
int32_t data;
4545
uint_fast16_t bptr = rxbuffer.tail;
4646

4747
if(bptr == rxbuffer.head)
4848
return -1; // no data available else EOF
4949

50-
data = rxbuffer.data[bptr++]; // Get next character, increment tmp pointer
50+
data = (int32_t)rxbuffer.data[bptr++]; // Get next character, increment tmp pointer
5151
rxbuffer.tail = bptr & (RX_BUFFER_SIZE - 1); // and update pointer
5252

5353
return data;
@@ -78,7 +78,7 @@ static void serialRxCancel (void)
7878
rxbuffer.head = (rxbuffer.tail + 1) & (RX_BUFFER_SIZE - 1);
7979
}
8080

81-
static bool serialPutC (const char c)
81+
static bool serialPutC (const uint8_t c)
8282
{
8383
uint_fast16_t next_head;
8484

@@ -102,7 +102,7 @@ static bool serialPutC (const char c)
102102

103103
static void serialWriteS (const char *data)
104104
{
105-
char c, *ptr = (char *)data;
105+
uint8_t c, *ptr = (uint8_t *)data;
106106

107107
while((c = *ptr++) != '\0')
108108
serialPutC(c);
@@ -189,9 +189,9 @@ static void uart_interrupt_handler (void)
189189
uart.rx_irq = 0;
190190
if(data == 0x06)
191191
sim.exit = exit_REQ;
192-
if(!enqueue_realtime_command((char)data)) {
193-
rxbuffer.data[rxbuffer.head] = (char)data; // Add data to buffer
194-
rxbuffer.head = bptr; // and update pointer
192+
if(!enqueue_realtime_command((uint8_t)data)) {
193+
rxbuffer.data[rxbuffer.head] = (uint8_t)data; // Add data to buffer
194+
rxbuffer.head = bptr; // and update pointer
195195
}
196196
}
197197
}

src/validator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Copyright (c) 2012 Adam Shelly
77
8-
2020 - modified for grblHAL by Terje Io
8+
2025 - modified for grblHAL by Terje Io
99
1010
Grbl is free software: you can redistribute it and/or modify
1111
it under the terms of the GNU General Public License as published by
@@ -80,9 +80,9 @@ status_code_t validator_report_status_message (status_code_t status_code)
8080
}
8181

8282
// Read fom input
83-
int16_t serial_read()
83+
int32_t serial_read()
8484
{
85-
int16_t data = fgetc(args.input_file);
85+
int32_t data = fgetc(args.input_file);
8686

8787
if (data == PLATFORM_EXTRA_CR)
8888
return(0);

0 commit comments

Comments
 (0)