[linux] Cleanup npl layer in linux port.

This commit is contained in:
Martin Turon
2018-11-05 14:36:34 +01:00
committed by Andrzej Kaczmarek
parent d15edf1282
commit 22e1e79295
10 changed files with 15 additions and 40 deletions
@@ -24,7 +24,7 @@
#include <stdint.h>
#include <string.h>
#include "npl_osal.h"
#include "os_types.h"
#ifdef __cplusplus
extern "C" {
@@ -34,10 +34,6 @@ extern "C" {
#define BLE_NPL_TIME_FOREVER INT32_MAX
/* This should be compatible with TickType_t */
typedef uint32_t ble_npl_time_t;
typedef int32_t ble_npl_stime_t;
#define SYSINIT_PANIC_MSG(msg) __assert_fail(msg, __FILE__, __LINE__, __func__)
#define SYSINIT_PANIC_ASSERT_MSG(rc, msg) do \
-29
View File
@@ -1,29 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef _NPL_OSAL_H
#define _NPL_OSAL_H
#include "os_types.h"
#include "nimble/nimble_npl.h"
#include "os/os.h"
#endif // _NPL_OSAL_H
+1 -1
View File
@@ -20,7 +20,7 @@
#include <stdint.h>
#include <pthread.h>
#include "npl_osal.h"
#include "nimble/nimble_npl.h"
static pthread_mutex_t s_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+1 -2
View File
@@ -25,7 +25,7 @@
#include <time.h>
#include <signal.h>
#include "npl_osal.h"
#include "nimble/nimble_npl.h"
static void
ble_npl_callout_timer_cb(union sigval sv)
@@ -40,7 +40,6 @@ ble_npl_callout_timer_cb(union sigval sv)
}
}
void ble_npl_callout_init(struct ble_npl_callout *c,
struct ble_npl_eventq *evq,
ble_npl_event_fn *ev_cb,
+1 -1
View File
@@ -21,7 +21,7 @@
#include <stdint.h>
#include <string.h>
#include "npl_osal.h"
#include "nimble/nimble_npl.h"
#include "wqueue.h"
extern "C" {
+1
View File
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include "os/os.h"
#include "nimble/nimble_npl.h"
#include <pthread.h>
+1
View File
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include "os/os.h"
#include "nimble/nimble_npl.h"
#include <errno.h>
#include <pthread.h>
+6
View File
@@ -18,6 +18,7 @@
*/
#include "os/os.h"
#include "nimble/nimble_npl.h"
#ifdef __cplusplus
extern "C" {
@@ -105,6 +106,11 @@ bool ble_npl_os_started(void)
return true;
}
void ble_npl_task_yield(void)
{
pthread_yield();
}
#ifdef __cplusplus
}
#endif
+1
View File
@@ -21,6 +21,7 @@
#include <stdint.h>
#include <string.h>
#include "os/os.h"
#include "nimble/nimble_npl.h"
#include <time.h>
+2 -2
View File
@@ -38,8 +38,6 @@ typedef int32_t ble_npl_stime_t;
//typedef int os_sr_t;
typedef int ble_npl_stack_t;
struct ble_npl_event;
typedef void ble_npl_event_fn(struct ble_npl_event *ev);
struct ble_npl_event {
uint8_t ev_queued;
@@ -82,4 +80,6 @@ int ble_npl_task_remove(struct ble_npl_task *t);
uint8_t ble_npl_task_count(void);
void ble_npl_task_yield(void);
#endif // _NPL_OS_TYPES_H