Remove useless include/hexagram/table.h

This commit is contained in:
XANTRONIX Development 2023-12-27 01:01:21 -05:00
parent eeeb5659a9
commit e7f2de41ca
4 changed files with 9 additions and 22 deletions

View file

@ -6,11 +6,12 @@
#include <sys/time.h>
#include <signal.h>
#include <hexagram/table.h>
#include <hexagram/can.h>
typedef struct _hexagram_schedule_slot {
time_t interval_us;
hexagram_table_entry *entry;
hexagram_can_if *iface;
struct can_frame frame;
} hexagram_schedule_slot;
typedef struct _hexagram_schedule {
@ -24,7 +25,7 @@ typedef struct _hexagram_schedule {
int error;
} hexagram_schedule;
hexagram_schedule *hexagram_schedule_create(hexagram_table_entry *table,
hexagram_schedule *hexagram_schedule_create(hexagram_schedule_slot *table,
size_t count);
void hexagram_schedule_destroy(hexagram_schedule *schedule);

View file

@ -1,13 +0,0 @@
#ifndef _HEXAGRAM_TABLE_H
#define _HEXAGRAM_TABLE_H
#include <sys/time.h>
#include <hexagram/can.h>
typedef struct _hexagram_table_entry {
time_t freq_us;
hexagram_can_if *iface;
struct can_frame frame;
} hexagram_table_entry;
#endif /* _HEXAGRAM_TABLE_H */

View file

@ -9,7 +9,7 @@ LDFLAGS = $(shell pkg-config --libs cairo x11) -lXext
HEADERS = dict.h hash.h can.h capture.h pcapng.h module.h window.h \
gauge.h tacho.h speedo.h thermo.h fuel.h mfd.h cluster.h \
sim.h schedule.h table.h
sim.h schedule.h
HEADERS_LOCAL = util.h

View file

@ -42,7 +42,7 @@ static void _ev_notify(hexagram_schedule *schedule) {
hexagram_schedule_slot *slot = _slot(schedule, schedule->current);
time_t delay = slot->interval_us;
if (hexagram_can_if_write(slot->entry->iface, &slot->entry->frame) < 0) {
if (hexagram_can_if_write(slot->iface, &slot->frame) < 0) {
schedule->error = errno;
break;
@ -65,7 +65,7 @@ static void _ev_notify(hexagram_schedule *schedule) {
}
static int _schedule_init(hexagram_schedule *schedule,
hexagram_table_entry *table,
hexagram_schedule_slot *table,
size_t count) {
size_t i;
@ -87,8 +87,7 @@ static int _schedule_init(hexagram_schedule *schedule,
for (i=0; i<count; i++) {
hexagram_schedule_slot *slot = &((hexagram_schedule_slot *)(schedule + 1))[i];
slot->interval_us = table[i].freq_us;
slot->entry = &table[i];
memcpy(slot, &table[i], sizeof(hexagram_schedule_slot));
}
qsort(schedule + 1, count, sizeof(hexagram_schedule_slot), _slot_cmp);
@ -99,7 +98,7 @@ error_timer_create:
return -1;
}
hexagram_schedule *hexagram_schedule_create(hexagram_table_entry *table,
hexagram_schedule *hexagram_schedule_create(hexagram_schedule_slot *table,
size_t count) {
hexagram_schedule *schedule;