summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@bpcspace.com>2023-10-27 08:20:18 -0500
committerBrett Weiland <brett_weiland@bpcspace.com>2023-10-27 08:20:18 -0500
commitcdf430be43c5dabda35279c0fa3eed19c8c5d011 (patch)
tree9b6bd0886c53555aded030312ad533891eae2e21
parenteb86bdacd8b2908c7a4146aafd2b5696bd5cfafe (diff)
aboutta have dead battery
-rw-r--r--software_pwm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/software_pwm.c b/software_pwm.c
index 2334976..ca120d9 100644
--- a/software_pwm.c
+++ b/software_pwm.c
@@ -31,12 +31,12 @@ static struct pwm_event {
((struct pwm_event *)(char *)member_ptr - member_offset)
#define MEMBER_FROM_EVENT(event_ptr, member_offset) \
- ((struct link_pair *)(char *)event_
+ ((struct link_pair *)(char *)event_ptr + member_offset)
static void list_insert(struct link_pair *new_links, struct link_pair *prev_links, size_t parent_offset) {
new_links->next = prev_links->next;
new_links->prev = EVENT_FROM_MEMBER(prev_links, parent_offset);
- ((struct link_pair *)(char *)prev_links->next + parent_offset)->prev =
+ MEMBER_FROM_EVENT()->prev =
EVENT_FROM_MEMBER(new_links, parent_offset); //GYAAAAGH
prev_links->next = EVENT_FROM_MEMBER(prev_links, parent_offset);
}