Build blinkt and piface in gcc pipeline to prevent bit rot. (#842)
This commit is contained in:
@@ -247,3 +247,25 @@ jobs:
|
|||||||
run: make LEGACY=true BUILD=win32 router-mstp
|
run: make LEGACY=true BUILD=win32 router-mstp
|
||||||
- name: Build Win32 Demo Gateway
|
- name: Build Win32 Demo Gateway
|
||||||
run: make LEGACY=true BUILD=win32 gateway
|
run: make LEGACY=true BUILD=win32 gateway
|
||||||
|
|
||||||
|
piface:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Build PiFace Demo
|
||||||
|
run: |
|
||||||
|
gcc --version
|
||||||
|
make clean
|
||||||
|
make LEGACY=true BUILD=pipeline piface
|
||||||
|
|
||||||
|
blinkt:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Build Blinkt! Demo
|
||||||
|
run: |
|
||||||
|
gcc --version
|
||||||
|
make clean
|
||||||
|
make LEGACY=true BUILD=pipeline blinkt
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ TARGET = bacblinkt
|
|||||||
|
|
||||||
# BACnet objects that are used with this app
|
# BACnet objects that are used with this app
|
||||||
BACNET_OBJECT_DIR = $(BACNET_SRC_DIR)/bacnet/basic/object
|
BACNET_OBJECT_DIR = $(BACNET_SRC_DIR)/bacnet/basic/object
|
||||||
SRC = main.c \
|
SRC = main.c blinkt.c device.c \
|
||||||
blinkt.c \
|
|
||||||
device.c \
|
|
||||||
$(BACNET_OBJECT_DIR)/netport.c \
|
$(BACNET_OBJECT_DIR)/netport.c \
|
||||||
$(BACNET_OBJECT_DIR)/channel.c \
|
$(BACNET_OBJECT_DIR)/channel.c \
|
||||||
$(BACNET_OBJECT_DIR)/color_object.c \
|
$(BACNET_OBJECT_DIR)/color_object.c \
|
||||||
@@ -34,8 +32,12 @@ SIZE = $(CROSS_PREFIX)size
|
|||||||
|
|
||||||
# note: link to pigpio daemon so that our app can run without root
|
# note: link to pigpio daemon so that our app can run without root
|
||||||
# start pigpio daemon with the command 'sudo pigpiod'
|
# start pigpio daemon with the command 'sudo pigpiod'
|
||||||
|
ifeq (${BUILD},pipeline)
|
||||||
|
CFLAGS += -DBUILD_PIPELINE
|
||||||
|
else
|
||||||
LD_PIGPIO = -Wl,-pthread,-lpigpiod_if2
|
LD_PIGPIO = -Wl,-pthread,-lpigpiod_if2
|
||||||
LFLAGS += $(LD_PIGPIO)
|
LFLAGS += $(LD_PIGPIO)
|
||||||
|
endif
|
||||||
|
|
||||||
OBJS += ${SRC:.c=.o}
|
OBJS += ${SRC:.c=.o}
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -8,7 +8,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <pigpiod_if2.h>
|
|
||||||
#include "blinkt.h"
|
#include "blinkt.h"
|
||||||
|
|
||||||
#define BLINKT_DEFAULT_BRIGHTNESS 7
|
#define BLINKT_DEFAULT_BRIGHTNESS 7
|
||||||
@@ -23,6 +22,16 @@ static uint32_t Blinkt_LED[BLINKT_NUM_LEDS];
|
|||||||
/* handle to the pigpiod */
|
/* handle to the pigpiod */
|
||||||
static int Blinkt_Pi;
|
static int Blinkt_Pi;
|
||||||
|
|
||||||
|
#ifdef BUILD_PIPELINE
|
||||||
|
#define PI_OUTPUT 1
|
||||||
|
#define gpio_write(a, b, c) printf("gpio_write(%d, %d, %d)\n", a, b, c)
|
||||||
|
#define set_mode(a, b, c) printf("set_mode(%d, %d, %d)\n", a, b, c)
|
||||||
|
#define pigpio_start(a, b) printf("pigpio_start(%s, %s)\n", a, b)
|
||||||
|
#define pigpio_stop(a) printf("pigpio_stop(%d)\n", a)
|
||||||
|
#else
|
||||||
|
#include <pigpiod_if2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the number of LEDS
|
* @brief Get the number of LEDS
|
||||||
* @return Number of LEDs
|
* @return Number of LEDs
|
||||||
|
|||||||
@@ -39,8 +39,12 @@ MCP23S17_LIB = libmcp23s17
|
|||||||
|
|
||||||
CFLAGS += -I$(PIFACE_INCLUDE)
|
CFLAGS += -I$(PIFACE_INCLUDE)
|
||||||
|
|
||||||
|
ifeq (${BUILD},pipeline)
|
||||||
|
CFLAGS += -DBUILD_PIPELINE
|
||||||
|
else
|
||||||
LDPIFACE = -Wl,-L$(PIFACE_LIB),-lpifacedigital,-L$(MCP23S17_LIB),-lmcp23s17
|
LDPIFACE = -Wl,-L$(PIFACE_LIB),-lpifacedigital,-L$(MCP23S17_LIB),-lmcp23s17
|
||||||
LFLAGS += $(LDPIFACE)
|
LFLAGS += $(LDPIFACE)
|
||||||
|
endif
|
||||||
|
|
||||||
OBJS += ${SRC:.c=.o}
|
OBJS += ${SRC:.c=.o}
|
||||||
|
|
||||||
|
|||||||
+12
-5
@@ -1,11 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* @brief
|
* @brief Example server application using the BACnet Stack on a Raspberry Pi
|
||||||
|
* with a PiFace Digital I/O card.
|
||||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||||
* @date January 2023
|
* @date January 2023
|
||||||
*
|
* @copyright SPDX-License-Identifier: MIT
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@@ -37,7 +36,6 @@
|
|||||||
#include "bacnet/basic/object/bi.h"
|
#include "bacnet/basic/object/bi.h"
|
||||||
#include "bacnet/basic/object/blo.h"
|
#include "bacnet/basic/object/blo.h"
|
||||||
#include "bacnet/basic/object/bo.h"
|
#include "bacnet/basic/object/bo.h"
|
||||||
#include "pifacedigital.h"
|
|
||||||
|
|
||||||
/** @file server/main.c Example server application using the BACnet Stack. */
|
/** @file server/main.c Example server application using the BACnet Stack. */
|
||||||
|
|
||||||
@@ -59,6 +57,15 @@ static struct mstimer BACnet_Object_Timer;
|
|||||||
/* track the state of of the output */
|
/* track the state of of the output */
|
||||||
static bool PiFace_Output_State[PIFACE_OUTPUTS_MAX];
|
static bool PiFace_Output_State[PIFACE_OUTPUTS_MAX];
|
||||||
|
|
||||||
|
#ifndef BUILD_PIPELINE
|
||||||
|
#include "pifacedigital.h"
|
||||||
|
#else
|
||||||
|
#define pifacedigital_digital_write(a, b) printf("PiFace write[%u]=%d\n", a, b)
|
||||||
|
#define pifacedigital_digital_read(a) printf("PiFace read[%u]\n", a)
|
||||||
|
#define pifacedigital_open(a) printf("PiFace Open=%d\n", a)
|
||||||
|
#define pifacedigital_close(a) printf("PiFace Close=%d\n", a)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief output write value request
|
* @brief output write value request
|
||||||
* @param index - 0..N index of the output
|
* @param index - 0..N index of the output
|
||||||
|
|||||||
Reference in New Issue
Block a user