Fixed overlook device settings in config processing

This commit is contained in:
Paul Dino Jones 2024-09-19 21:22:00 -04:00
parent c4a1cbcfb8
commit ec6cb073ee
5 changed files with 22 additions and 3 deletions

View File

@ -133,14 +133,13 @@ int serialdev_free(SimDevice* this)
int serialdev_init(SerialDevice* serialdevice, DeviceSettings* ds) int serialdev_init(SerialDevice* serialdevice, DeviceSettings* ds)
{ {
slogi("initializing serial device..."); slogi("initializing serial device on port %s...", ds->serialdevsettings.portdev);
int error = 0; int error = 0;
serialdevice->motorsposition = ds->serialdevsettings.motorsposition; serialdevice->motorsposition = ds->serialdevsettings.motorsposition;
serialdevice->baudrate = ds->serialdevsettings.baud; serialdevice->baudrate = ds->serialdevsettings.baud;
error = arduino_init(serialdevice, ds->serialdevsettings.portdev);
switch (serialdevice->type) switch (serialdevice->type)
{ {
case SERIALDEV_WHEEL: case SERIALDEV_WHEEL:

View File

@ -551,7 +551,7 @@ int devsetup(const char* device_type, const char* device_subtype, const char* co
} }
} }
if (ds->dev_subtype == SIMDEVTYPE_SIMWIND || ds->dev_subtype == SIMDEVTYPE_SHIFTLIGHTS || ds->dev_subtype == SIMDEVTYPE_SERIALHAPTIC) if (ds->dev_type == SIMDEV_SERIAL)
{ {
if (device_settings != NULL) if (device_settings != NULL)
{ {

BIN
tests/a.out Executable file

Binary file not shown.

BIN
tests/producer Executable file

Binary file not shown.

View File

@ -0,0 +1,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <errno.h>
void display(char* prog, char* bytes, int n);
int main(void)
{
const char* name = "acpmf_physics"; // file name
shm_unlink(name);
}