NRF: receive, ntp, Data to Sd-card working

Dependencies:   F7_Ethernet mbed BSP_DISCO_F746NG Test_Mainboard SDFileSystem RF24

Committer:
lowlowry
Date:
Sun Jun 20 13:48:06 2021 +0000
Revision:
4:5ecb71f149bf
Parent:
0:d984976f1f1c
NRF: receive, ntp, Data to Sd-card working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
leo44 0:d984976f1f1c 1 /* mbed Microcontroller Library
leo44 0:d984976f1f1c 2 * Copyright (c) 2006-2012 ARM Limited
leo44 0:d984976f1f1c 3 *
leo44 0:d984976f1f1c 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
leo44 0:d984976f1f1c 5 * of this software and associated documentation files (the "Software"), to deal
leo44 0:d984976f1f1c 6 * in the Software without restriction, including without limitation the rights
leo44 0:d984976f1f1c 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
leo44 0:d984976f1f1c 8 * copies of the Software, and to permit persons to whom the Software is
leo44 0:d984976f1f1c 9 * furnished to do so, subject to the following conditions:
leo44 0:d984976f1f1c 10 *
leo44 0:d984976f1f1c 11 * The above copyright notice and this permission notice shall be included in
leo44 0:d984976f1f1c 12 * all copies or substantial portions of the Software.
leo44 0:d984976f1f1c 13 *
leo44 0:d984976f1f1c 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
leo44 0:d984976f1f1c 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
leo44 0:d984976f1f1c 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
leo44 0:d984976f1f1c 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
leo44 0:d984976f1f1c 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
leo44 0:d984976f1f1c 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
leo44 0:d984976f1f1c 20 * SOFTWARE.
leo44 0:d984976f1f1c 21 */
leo44 0:d984976f1f1c 22 #include "Semaphore.h"
leo44 0:d984976f1f1c 23
leo44 0:d984976f1f1c 24 #include <string.h>
leo44 0:d984976f1f1c 25
leo44 0:d984976f1f1c 26 namespace rtos {
leo44 0:d984976f1f1c 27
leo44 0:d984976f1f1c 28 Semaphore::Semaphore(int32_t count) {
leo44 0:d984976f1f1c 29 #ifdef CMSIS_OS_RTX
leo44 0:d984976f1f1c 30 memset(_semaphore_data, 0, sizeof(_semaphore_data));
leo44 0:d984976f1f1c 31 _osSemaphoreDef.semaphore = _semaphore_data;
leo44 0:d984976f1f1c 32 #endif
leo44 0:d984976f1f1c 33 _osSemaphoreId = osSemaphoreCreate(&_osSemaphoreDef, count);
leo44 0:d984976f1f1c 34 }
leo44 0:d984976f1f1c 35
leo44 0:d984976f1f1c 36 int32_t Semaphore::wait(uint32_t millisec) {
leo44 0:d984976f1f1c 37 return osSemaphoreWait(_osSemaphoreId, millisec);
leo44 0:d984976f1f1c 38 }
leo44 0:d984976f1f1c 39
leo44 0:d984976f1f1c 40 osStatus Semaphore::release(void) {
leo44 0:d984976f1f1c 41 return osSemaphoreRelease(_osSemaphoreId);
leo44 0:d984976f1f1c 42 }
leo44 0:d984976f1f1c 43
leo44 0:d984976f1f1c 44 Semaphore::~Semaphore() {
leo44 0:d984976f1f1c 45 osSemaphoreDelete(_osSemaphoreId);
leo44 0:d984976f1f1c 46 }
leo44 0:d984976f1f1c 47
leo44 0:d984976f1f1c 48 }