Minor project changes
This commit is contained in:
parent
c0081fc459
commit
cece827795
1
.gitignore
vendored
1
.gitignore
vendored
@ -36,6 +36,7 @@
|
||||
|
||||
outdir
|
||||
**outdir
|
||||
**BUILD
|
||||
|
||||
.built-in.o.cmd
|
||||
.main.o.cmd
|
||||
|
4
.vscode/arduino.json
vendored
Normal file
4
.vscode/arduino.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"board": "AZ3166:stm32f4:MXCHIP_AZ3166",
|
||||
"configuration": "upload_method=OpenOCDMethod"
|
||||
}
|
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
//"C_Cpp.intelliSenseEngine": "Default" // Does not work with "Go to definition" etc.
|
||||
"C_Cpp.intelliSenseEngine": "Tag Parser"
|
||||
}
|
5
prj.conf
5
prj.conf
@ -1,5 +0,0 @@
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_NANO_TIMERS=y
|
||||
CONFIG_NANO_TIMEOUTS=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_SERIAL=n
|
@ -1 +0,0 @@
|
||||
obj-y = main.o
|
38
src/main.c
38
src/main.c
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <board.h>
|
||||
#include <device.h>
|
||||
#include <gpio.h>
|
||||
|
||||
/* Change this if you have an LED connected to a custom port */
|
||||
//#define PORT "GPIOA"
|
||||
#define PORT LED0_GPIO_PORT
|
||||
|
||||
/* Change this if you have an LED connected to a custom pin */
|
||||
//#define LED 4
|
||||
#define LED LED0_GPIO_PIN
|
||||
|
||||
/* 1000 msec = 1 sec */
|
||||
#define SLEEP_TIME 500
|
||||
|
||||
void main(void)
|
||||
{
|
||||
int cnt = 0;
|
||||
struct device *dev;
|
||||
|
||||
dev = device_get_binding(PORT);
|
||||
/* Set LED pin as output */
|
||||
gpio_pin_configure(dev, LED, GPIO_DIR_OUT);
|
||||
|
||||
while (1) {
|
||||
/* Set pin to HIGH/LOW every 1 second */
|
||||
gpio_pin_write(dev, LED, cnt % 2);
|
||||
cnt++;
|
||||
k_sleep(SLEEP_TIME);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user