[BSP] fix compiling issue
This commit is contained in:
parent
f47898bb17
commit
591339e7a8
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
#include <finsh.h>
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include <interrupt.h>
|
#include <interrupt.h>
|
||||||
|
|
|
@ -34,8 +34,6 @@
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
|
|
||||||
#if defined(RT_USING_DFS)
|
#if defined(RT_USING_DFS)
|
||||||
/* dfs init */
|
|
||||||
#include <dfs_init.h>
|
|
||||||
/* dfs filesystem:ELM filesystem init */
|
/* dfs filesystem:ELM filesystem init */
|
||||||
#include <dfs_elm.h>
|
#include <dfs_elm.h>
|
||||||
/* dfs Filesystem APIs */
|
/* dfs Filesystem APIs */
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
*/
|
*/
|
||||||
/*@{*/
|
/*@{*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "MK64F12.h"
|
#include "MK64F12.h"
|
||||||
|
@ -25,12 +26,6 @@
|
||||||
|
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
#ifdef RT_USING_LWIP
|
|
||||||
#include <lwip/sys.h>
|
|
||||||
#include <lwip/api.h>
|
|
||||||
#include <netif/ethernetif.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void rt_init_thread_entry(void* parameter)
|
void rt_init_thread_entry(void* parameter)
|
||||||
{
|
{
|
||||||
#ifdef RT_USING_COMPONENTS_INIT
|
#ifdef RT_USING_COMPONENTS_INIT
|
||||||
|
@ -72,15 +67,9 @@ int rt_application_init()
|
||||||
{
|
{
|
||||||
rt_thread_t init_thread;
|
rt_thread_t init_thread;
|
||||||
|
|
||||||
#if (RT_THREAD_PRIORITY_MAX == 32)
|
|
||||||
init_thread = rt_thread_create("init",
|
init_thread = rt_thread_create("init",
|
||||||
rt_init_thread_entry, RT_NULL,
|
rt_init_thread_entry, RT_NULL,
|
||||||
2048, 8, 20);
|
2048, RT_THREAD_PRIORITY_MAX/3, 20);
|
||||||
#else
|
|
||||||
init_thread = rt_thread_create("init",
|
|
||||||
rt_init_thread_entry, RT_NULL,
|
|
||||||
2048, 80, 20);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (init_thread != RT_NULL)
|
if (init_thread != RT_NULL)
|
||||||
rt_thread_startup(init_thread);
|
rt_thread_startup(init_thread);
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
#ifdef RT_USING_DFS
|
#ifdef RT_USING_DFS
|
||||||
/* dfs init */
|
|
||||||
#include <dfs_init.h>
|
|
||||||
/* dfs filesystem:ELM FatFs filesystem init */
|
/* dfs filesystem:ELM FatFs filesystem init */
|
||||||
#include <dfs_elm.h>
|
#include <dfs_elm.h>
|
||||||
/* dfs Filesystem APIs */
|
/* dfs Filesystem APIs */
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
/* SECTION: Device System */
|
/* SECTION: Device System */
|
||||||
/* Using Device System*/
|
/* Using Device System*/
|
||||||
#define RT_USING_DEVICE
|
#define RT_USING_DEVICE
|
||||||
|
#define RT_USING_DEVICE_IPC
|
||||||
|
|
||||||
#define RT_USING_UART1
|
#define RT_USING_UART1
|
||||||
// #define RT_USING_UART2
|
// #define RT_USING_UART2
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
#define RT_LWIP_ETH_PAD_SIZE 2
|
#define RT_LWIP_ETH_PAD_SIZE 2
|
||||||
|
|
||||||
/* Enable SNMP protocol*/
|
/* Enable SNMP protocol*/
|
||||||
#define RT_LWIP_SNMP
|
//#define RT_LWIP_SNMP
|
||||||
|
|
||||||
/* Using DHCP*/
|
/* Using DHCP*/
|
||||||
/* #define RT_LWIP_DHCP */
|
/* #define RT_LWIP_DHCP */
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
#include "dm9000.h"
|
#include "dm9000.h"
|
||||||
|
|
||||||
#ifdef RT_USING_DFS
|
#ifdef RT_USING_DFS
|
||||||
/* dfs init */
|
|
||||||
#include <dfs_init.h>
|
|
||||||
/* dfs filesystem:ELM FatFs filesystem init */
|
/* dfs filesystem:ELM FatFs filesystem init */
|
||||||
#include <dfs_elm.h>
|
#include <dfs_elm.h>
|
||||||
/* dfs Filesystem APIs */
|
/* dfs Filesystem APIs */
|
||||||
|
|
|
@ -398,7 +398,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev,
|
||||||
|
|
||||||
if (dev == RT_NULL)
|
if (dev == RT_NULL)
|
||||||
{
|
{
|
||||||
rt_set_errno(-DFS_STATUS_EINVAL);
|
rt_set_errno(-EINVAL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -429,7 +429,7 @@ static rt_size_t rt_sdcard_write(rt_device_t dev,
|
||||||
|
|
||||||
if (dev == RT_NULL)
|
if (dev == RT_NULL)
|
||||||
{
|
{
|
||||||
rt_set_errno(-DFS_STATUS_EINVAL);
|
rt_set_errno(-EINVAL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
|
|
||||||
// <section name="RT_USING_DEVICE" description="Using Device Driver Framework" default="true" >
|
// <section name="RT_USING_DEVICE" description="Using Device Driver Framework" default="true" >
|
||||||
#define RT_USING_DEVICE
|
#define RT_USING_DEVICE
|
||||||
|
#define RT_USING_DEVICE_IPC
|
||||||
// <bool name="RT_USING_UART0" description="Using UART0" default="true" />
|
// <bool name="RT_USING_UART0" description="Using UART0" default="true" />
|
||||||
#define RT_USING_UART0
|
#define RT_USING_UART0
|
||||||
// <integer name="RT_UART_RX_BUFFER_SIZE" description="The buffer size for UART reception" default="64" />
|
// <integer name="RT_UART_RX_BUFFER_SIZE" description="The buffer size for UART reception" default="64" />
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
* 2013-11-15 bright the first version
|
* 2013-11-15 bright the first version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <rtthread.h>
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -20,7 +21,7 @@ LED_RED : PC9
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Initial led gpio pin */
|
/* Initial led gpio pin */
|
||||||
void rt_hw_led_init(void)
|
int rt_hw_led_init(void)
|
||||||
{
|
{
|
||||||
GPIO_InitTypeDef GPIO_InitStructure;
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
|
||||||
|
@ -34,7 +35,8 @@ void rt_hw_led_init(void)
|
||||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||||
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||||||
}
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
/* Initial components for device */
|
/* Initial components for device */
|
||||||
INIT_DEVICE_EXPORT(rt_hw_led_init);
|
INIT_DEVICE_EXPORT(rt_hw_led_init);
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
#ifndef __LED_H__
|
#ifndef __LED_H__
|
||||||
#define __LED_H__
|
#define __LED_H__
|
||||||
|
|
||||||
#include <rthw.h>
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
#include <stm32f0xx.h>
|
#include <stm32f0xx.h>
|
||||||
|
|
||||||
#define rt_hw_led_on() GPIO_SetBits(GPIOC, GPIO_Pin_9)
|
#define rt_hw_led_on() GPIO_SetBits(GPIOC, GPIO_Pin_9)
|
||||||
#define rt_hw_led_off() GPIO_ResetBits(GPIOC, GPIO_Pin_9)
|
#define rt_hw_led_off() GPIO_ResetBits(GPIOC, GPIO_Pin_9)
|
||||||
|
|
||||||
void rt_hw_led_init(void);
|
int rt_hw_led_init(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define RT_USING_SEMAPHORE
|
#define RT_USING_SEMAPHORE
|
||||||
|
|
||||||
/* Using Mutex */
|
/* Using Mutex */
|
||||||
/* #define RT_USING_MUTEX */
|
#define RT_USING_MUTEX
|
||||||
|
|
||||||
/* Using Event */
|
/* Using Event */
|
||||||
/* #define RT_USING_EVENT */
|
/* #define RT_USING_EVENT */
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#ifdef RT_USING_DFS
|
#ifdef RT_USING_DFS
|
||||||
#include <dfs_fs.h>
|
#include <dfs_fs.h>
|
||||||
#include <dfs_init.h>
|
|
||||||
#include <dfs_elm.h>
|
#include <dfs_elm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@ typedef rt_int32_t int32_t;
|
||||||
typedef rt_uint32_t uint32_t;
|
typedef rt_uint32_t uint32_t;
|
||||||
typedef long long int64_t;
|
typedef long long int64_t;
|
||||||
typedef unsigned long long uint64_t;
|
typedef unsigned long long uint64_t;
|
||||||
|
typedef signed long intptr_t;
|
||||||
|
typedef unsigned long uintptr_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 7.18.2 Limits of specified-width integer types.
|
* 7.18.2 Limits of specified-width integer types.
|
||||||
|
|
|
@ -4,5 +4,15 @@
|
||||||
#define BUFSIZ 128
|
#define BUFSIZ 128
|
||||||
#define EOF (-1)
|
#define EOF (-1)
|
||||||
|
|
||||||
|
#ifndef SEEK_SET
|
||||||
|
#define SEEK_SET 0 /* set file offset to offset */
|
||||||
|
#endif
|
||||||
|
#ifndef SEEK_CUR
|
||||||
|
#define SEEK_CUR 1 /* set file offset to current plus offset */
|
||||||
|
#endif
|
||||||
|
#ifndef SEEK_END
|
||||||
|
#define SEEK_END 2 /* set file offset to EOF plus offset */
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue