Skip to content

Commit

Permalink
added IO named pipe thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Paciente8159 committed Nov 14, 2023
1 parent 3d954a0 commit a907301
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions uCNC/src/hal/mcus/virtual/mcu_virtual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ extern "C"

static volatile VIRTUAL_MAP virtualmap;

void ioserver(void *args)
void* ioserver(void *args)
{
HANDLE hPipe;
TCHAR chBuf[sizeof(VIRTUAL_MAP)];
Expand Down Expand Up @@ -354,7 +354,7 @@ extern "C"
if (hPipe == INVALID_HANDLE_VALUE)
{
printf("CreateNamedPipe failed, GLE=%d.\n", GetLastError());
return;
return NULL;
}

// Wait for the client to connect; if it succeeds,
Expand Down Expand Up @@ -429,7 +429,7 @@ extern "C"
CloseHandle(hPipe);
}

return;
return NULL;
}

uint8_t mcu_get_pin_offset(uint8_t pin)
Expand Down Expand Up @@ -777,7 +777,7 @@ extern "C"
/**
* Initialize the MCU
* **/

pthread_t thread_io;
void mcu_init(void)
{
startCycleCounter();
Expand All @@ -787,6 +787,7 @@ extern "C"
virtualmap.outputs = 0;
g_cpu_freq = getCPUFreq();
start_timer(1, &ticksimul);
pthread_create(&thread_io, NULL, &ioserver, NULL);
mcu_enable_global_isr();
}

Expand Down
2 changes: 1 addition & 1 deletion uCNC/src/hal/mcus/virtual/mcumap_virtual.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#define MCU_CYCLES_PER_LOOP_OVERHEAD 0
#endif

// #define MCU_HAS_UART
#define MCU_HAS_UART
#ifndef UART_PORT_NAME
#define UART_PORT_NAME "COM1"
#endif
Expand Down

0 comments on commit a907301

Please sign in to comment.