Skip to content

Commit d0dcb22

Browse files
committed
Merge branch 'release/v5.2.0'
2 parents 6c55085 + 11227cb commit d0dcb22

File tree

33 files changed

+619
-215
lines changed

33 files changed

+619
-215
lines changed

.github/workflows/examples.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Examples
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-16.04, windows-latest, macos-latest]
11+
python-version: [2.7, 3.7]
12+
example:
13+
- "examples/mbed-blink"
14+
- "examples/mbed-dsp"
15+
- "examples/mbed-events"
16+
- "examples/mbed-rtos"
17+
- "examples/mbed-serial"
18+
- "examples/mbed-custom-target"
19+
- "examples/zephyr-blink"
20+
- "examples/zephyr-custom-board"
21+
- "examples/zephyr-synchronization"
22+
exclude:
23+
- {python-version: 2.7, example: "examples/zephyr-blink"}
24+
- {python-version: 2.7, example: "examples/zephyr-custom-board"}
25+
- {python-version: 2.7, example: "examples/zephyr-synchronization"}
26+
runs-on: ${{ matrix.os }}
27+
steps:
28+
- uses: actions/checkout@v2
29+
with:
30+
submodules: "recursive"
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v1
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -U https://github.com/platformio/platformio/archive/develop.zip
39+
platformio platform install file://.
40+
- name: Build examples
41+
run: |
42+
platformio run -d ${{ matrix.example }}

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NXP LPC: development platform for [PlatformIO](http://platformio.org)
2-
[![Build Status](https://travis-ci.org/platformio/platform-nxplpc.svg?branch=develop)](https://travis-ci.org/platformio/platform-nxplpc)
3-
[![Build status](https://ci.appveyor.com/api/projects/status/gm98eo04per1je25/branch/develop?svg=true)](https://ci.appveyor.com/project/ivankravets/platform-nxplpc/branch/develop)
2+
3+
[![Build Status](https://github.com/platformio/platform-nxplpc/workflows/Examples/badge.svg)](https://github.com/platformio/platform-nxplpc/actions)
44

55
The NXP LPC is a family of 32-bit microcontroller integrated circuits by NXP Semiconductors. The LPC chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Internally, each microcontroller consists of the processor core, static RAM memory, flash memory, debugging interface, and various peripherals.
66

appveyor.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

boards/lpcxpresso55s16.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"build": {
3+
"cpu": "cortex-m33",
4+
"f_cpu": "150000000L",
5+
"mcu": "lpc55s16",
6+
"zephyr": {
7+
"variant": "lpcxpresso55s16_ns"
8+
}
9+
},
10+
"connectivity": [
11+
"ethernet"
12+
],
13+
"debug": {
14+
"jlink_device": "LPC55S16",
15+
"onboard_tools": [
16+
"jlink"
17+
]
18+
},
19+
"frameworks": [
20+
"zephyr"
21+
],
22+
"name": "NXP LPCXpresso55S16",
23+
"upload": {
24+
"maximum_ram_size": 98304,
25+
"maximum_size": 262144,
26+
"protocol": "jlink",
27+
"protocols": [
28+
"jlink",
29+
"mbed"
30+
]
31+
},
32+
"url": "https://www.nxp.com/design/development-boards/lpcxpresso-boards/lpcxpresso55s16-development-board:LPC55S16-EVK",
33+
"vendor": "NXP"
34+
}

examples/zephyr-blink/platformio.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@
1111
platform = nxplpc
1212
framework = zephyr
1313
board = lpc54114
14+
15+
[env:lpcxpresso55s16]
16+
platform = nxplpc
17+
framework = zephyr
18+
board = lpcxpresso55s16

examples/zephyr-blink/src/main.c

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,52 @@
66

77
#include <zephyr.h>
88
#include <device.h>
9+
#include <devicetree.h>
910
#include <drivers/gpio.h>
1011

11-
#define LED_PORT DT_ALIAS_LED0_GPIOS_CONTROLLER
12-
#define LED DT_ALIAS_LED0_GPIOS_PIN
1312

1413
/* 1000 msec = 1 sec */
15-
#define SLEEP_TIME 1000
14+
#define SLEEP_TIME_MS 1000
15+
16+
/* The devicetree node identifier for the "led0" alias. */
17+
#define LED0_NODE DT_ALIAS(led0)
18+
19+
#if DT_NODE_HAS_STATUS(LED0_NODE, okay)
20+
#define LED0 DT_GPIO_LABEL(LED0_NODE, gpios)
21+
#define PIN DT_GPIO_PIN(LED0_NODE, gpios)
22+
#if DT_PHA_HAS_CELL(LED0_NODE, gpios, flags)
23+
#define FLAGS DT_GPIO_FLAGS(LED0_NODE, gpios)
24+
#endif
25+
#else
26+
/* A build error here means your board isn't set up to blink an LED. */
27+
#error "Unsupported board: led0 devicetree alias is not defined"
28+
#define LED0 ""
29+
#define PIN 0
30+
#endif
31+
32+
#ifndef FLAGS
33+
#define FLAGS 0
34+
#endif
1635

1736
void main(void)
1837
{
19-
u32_t cnt = 0;
2038
struct device *dev;
39+
bool led_is_on = true;
40+
int ret = 0;
2141

22-
dev = device_get_binding(LED_PORT);
23-
/* Set LED pin as output */
24-
gpio_pin_configure(dev, LED, GPIO_DIR_OUT);
42+
dev = device_get_binding(LED0);
43+
if (dev == NULL) {
44+
return;
45+
}
46+
47+
ret = gpio_pin_configure(dev, PIN, GPIO_OUTPUT_ACTIVE | FLAGS);
48+
if (ret < 0) {
49+
return;
50+
}
2551

2652
while (1) {
27-
/* Set pin to HIGH/LOW every 1 second */
28-
gpio_pin_write(dev, LED, cnt % 2);
29-
cnt++;
30-
k_sleep(SLEEP_TIME);
53+
gpio_pin_set(dev, PIN, (int)led_is_on);
54+
led_is_on = !led_is_on;
55+
k_msleep(SLEEP_TIME_MS);
3156
}
3257
}

0 commit comments

Comments
 (0)