Skip to content

Commit

Permalink
Merge pull request #60 from Luos-io/workflow
Browse files Browse the repository at this point in the history
New 1.0.0 branch
  • Loading branch information
Nicolas Rabault authored Nov 28, 2020
2 parents cc61ae4 + 640fffb commit 31b2ada
Show file tree
Hide file tree
Showing 21 changed files with 416 additions and 258 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Build

on: [push]

jobs:

build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
include:
- os: windows-latest
pio_lib_path: D:\a\Luos
- os: macos-latest
pio_lib_path: ~/work/Luos
- os: ubuntu-latest
pio_lib_path: ~/work/Luos


steps:

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Check out Luos repository
uses: actions/checkout@v2
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Create env repo
shell: bash
run: |
# Save branch name
branch_name=$(git branch --show-current)
origine_branch_name="origin/${branch_name}"
# Step back and get dependancies
cd ..
# LuosHAL
git clone https://github.com/Luos-io/LuosHAL.git
cd LuosHAL
if [ `git branch -r --list $origine_branch_name` ]
then
echo A dependant branch have been found on LuosHAL
git checkout $branch_name
fi
cd ..
# Examples
git clone https://github.com/Luos-io/Examples.git
cd Examples
if [ `git branch -r --list $origine_branch_name` ]
then
echo A dependant branch have been found on Examples
git checkout $branch_name
fi
cd ..
- name: Run PlatformIO
env:
PLATFORMIO_LIB_EXTRA_DIRS: ${{ matrix.pio_lib_path }}
run: |
cd ..
platformio run -d Examples/Projects/Button
platformio run -d Examples/Projects/Controller_motor
platformio run -d Examples/Projects/Dc_motor
platformio run -d Examples/Projects/Distance
platformio run -d Examples/Projects/Dxl
platformio run -d Examples/Projects/Gate
platformio run -d Examples/Projects/Gpio
platformio run -d Examples/Projects/Imu
platformio run -d Examples/Projects/Led
platformio run -d Examples/Projects/Led_strip
platformio run -d Examples/Projects/Light_sensor
platformio run -d Examples/Projects/Load
platformio run -d Examples/Projects/Potentiometer
platformio run -d Examples/Projects/Power_switch
platformio run -d Examples/Projects/Servo
platformio run -d Examples/Projects/Stepper
platformio run -d Examples/Projects/Bike_alarm/Alarm_controller
platformio run -d Examples/Projects/Bike_alarm/Start_controller
25 changes: 25 additions & 0 deletions .github/workflows/pio_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Upload platformio library

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Build and publish
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PIO_TOKEN }}
run: |
pio package pack
pio package publish --owner "Luos"
16 changes: 8 additions & 8 deletions Robus/inc/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <robus.h>
#include "config.h"
#include "portManager.h"
#include "port_manager.h"
#include "reception.h"
#include "transmission.h"
/*******************************************************************************
Expand All @@ -19,15 +19,15 @@ typedef struct
{

// Variables
node_t node; /*!< Node informations. */
RxCom_t rx; /*!< Receiver informations. */
TxCom_t tx; /*!< Transmitter informations. */
uint8_t ack; /*!< Ack informations. */
PortMng_t port; /*!< port informations. */
node_t node; /*!< Node informations. */
RxCom_t rx; /*!< Receiver informations. */
TxCom_t tx; /*!< Transmitter informations. */
uint8_t ack; /*!< Ack informations. */
PortMng_t port; /*!< port informations. */

//Virtual container management
ll_container_t ll_container_table[MAX_CONTAINER_NUMBER]; /*!< Virtual Container table. */
uint16_t ll_container_number; /*!< Virtual Container number. */
ll_container_t ll_container_table[MAX_CONTAINER_NUMBER]; /*!< Virtual Container table. */
uint16_t ll_container_number; /*!< Virtual Container number. */

} context_t;

Expand Down
2 changes: 1 addition & 1 deletion Robus/inc/msgAlloc.h → Robus/inc/msg_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void MsgAlloc_Init(memory_stats_t *memory_stats);
void MsgAlloc_loop(void);

// msg buffering functions
void MsgAlloc_ValidHeader(uint8_t status, uint16_t data_size);
void MsgAlloc_ValidHeader(uint8_t valid, uint16_t data_size);
void MsgAlloc_InvalidMsg(void);
void MsgAlloc_EndMsg(void);
void MsgAlloc_SetData(uint8_t data);
Expand Down
7 changes: 3 additions & 4 deletions Robus/inc/portManager.h → Robus/inc/port_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
typedef struct
{
//Port manager
volatile uint8_t activ; //last Port where thereis activity
volatile uint8_t keepLine; //status of the line poked by your node
}
PortMng_t;
volatile uint8_t activ; //last Port where thereis activity
volatile uint8_t keepLine; //status of the line poked by your node
} PortMng_t;
/*******************************************************************************
* Function
******************************************************************************/
Expand Down
3 changes: 1 addition & 2 deletions Robus/inc/reception.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ typedef struct
{
DATA_CB callback;
status_t status;
}
RxCom_t;
} RxCom_t;
/*******************************************************************************
* Variables
******************************************************************************/
Expand Down
17 changes: 14 additions & 3 deletions Robus/inc/robus_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ typedef struct __attribute__((__packed__))
uint8_t msg_drop_number;
} memory_stats_t;

typedef struct __attribute__((__packed__))
{
uint8_t msg_nbr;
uint8_t fail_msg_nbr;
uint8_t *max_collision_retry;
uint8_t *max_nak_retry;
} ll_stats_t;
/*
* This structure is used to get the message addressing mode list.
*/
Expand Down Expand Up @@ -69,7 +76,7 @@ typedef struct __attribute__((__packed__))
{
struct __attribute__((__packed__))
{
header_t header; /*!< Header filed. */
header_t header; /*!< Header filed. */
uint8_t data[MAX_DATA_MSG_SIZE]; /*!< Data with size known. */
};
uint8_t stream[sizeof(header_t) + MAX_DATA_MSG_SIZE]; /*!< unmaped option. */
Expand All @@ -90,6 +97,9 @@ typedef struct __attribute__((__packed__))
uint16_t max_multicast_target; /*!< Position pointer of the last multicast target. */
uint16_t multicast_target_bank[MAX_MULTICAST_ADDRESS]; /*!< multicast target bank. */
uint16_t dead_container_spotted; /*!< The ID of a container that don't reply to a lot of ACK msg */

//variable stat on robus com for ll_container
ll_stats_t ll_stat;
} ll_container_t;

/******************************************************************************
Expand All @@ -98,8 +108,8 @@ typedef struct __attribute__((__packed__))
******************************************************************************/
typedef enum
{
SUCESS, /*!< function work properly. */
FAIL = 0xFF /*!< function fail. */
SUCCEED, /*!< function work properly. */
FAILED = 0xFF /*!< function fail. */
} error_return_t;

/******************************************************************************
Expand Down Expand Up @@ -129,6 +139,7 @@ typedef enum
WRITE_NODE_ID, /*!< Get and save a new given node ID. */
RESET_DETECTION, /*!< Reset detection*/
SET_BAUDRATE, /*!< Set Robus baudrate*/
ASSERT, /*!< Node Assert message (only broadcast with a source as a node */
ROBUS_PROTOCOL_NB,
} robus_cmd_t;

Expand Down
5 changes: 2 additions & 3 deletions Robus/inc/transmission.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
******************************************************************************/
typedef struct
{
uint8_t* data;
uint8_t *data;
volatile uint8_t lock;
volatile uint8_t collision;
}
TxCom_t;
} TxCom_t;
/*******************************************************************************
* Variables
******************************************************************************/
Expand Down
Loading

0 comments on commit 31b2ada

Please sign in to comment.