Made the sss7core actually use _Atomic
This commit is contained in:
parent
e5b6fe4e5b
commit
7c13c4c5ca
|
@ -5,7 +5,7 @@ OBJDIR = bin
|
|||
|
||||
CC = clang
|
||||
|
||||
CFLAGS = -I ../sss7core/ -Os -Wall -Wstrict-prototypes -fPIC
|
||||
CFLAGS = -DSSS7_THREADED -I ../sss7core/ -Os -Wall -Wstrict-prototypes -fPIC
|
||||
LDFLAGS = -pthread -Wl,--gc-sections
|
||||
|
||||
all: start $(OBJDIR)/libsss7.so $(OBJDIR)/test
|
||||
|
|
|
@ -85,7 +85,7 @@ void sss7_process_rx(void) {
|
|||
uint8_t next_buffer_write = 0;
|
||||
sss7_timeout_counter = 0;
|
||||
|
||||
switch(sss7_state) {
|
||||
switch((int) sss7_state) {
|
||||
case SSS7_IDLE:
|
||||
if(byte == SSS7_HEADER[0]) {
|
||||
sss7_state = SSS7_RX_HEADER;
|
||||
|
@ -141,7 +141,7 @@ void sss7_process_rx(void) {
|
|||
void sss7_process_tx(void) {
|
||||
if(sss7_tx_last_ack) {
|
||||
uint8_t byte;
|
||||
switch(sss7_state) {
|
||||
switch((int) sss7_state) {
|
||||
case SSS7_TX_HEADER:
|
||||
sss7_send_byte(SSS7_HEADER[1]);
|
||||
sss7_state = SSS7_TX_PAYLOAD;
|
||||
|
@ -178,7 +178,7 @@ void sss7_process_ticks(uint16_t ticks) {
|
|||
sss7_timeout_counter = sss7_timeout_counter + ticks;
|
||||
|
||||
if(sss7_timeout_counter > sss7_timeout) {
|
||||
switch(sss7_state) {
|
||||
switch((int) sss7_state) {
|
||||
case SSS7_TX_HEADER:
|
||||
case SSS7_TX_PAYLOAD:
|
||||
case SSS7_TX_CRC:
|
||||
|
|
|
@ -7,7 +7,9 @@ extern "C" {
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef sss7_shared_modfier
|
||||
#ifdef SSS7_THREADED
|
||||
#define sss7_shared_modfier _Atomic
|
||||
#else
|
||||
#define sss7_shared_modfier volatile
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue