9 years, 9 months ago.

Mutex.cpp can't find #include "mbed_error.h"

Hello,all I build to on-line compile to 11U68 mbed offcial RTOS lib. But, can't find #include "mbed_error.h". Therefore, err,

/* mbed Microcontroller Library
 * Copyright (c) 2006-2012 ARM Limited
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
#include "Mutex.h"

#include <string.h>
#include "mbed_error.h"

namespace rtos {

Mutex::Mutex() {
#ifdef CMSIS_OS_RTX
    memset(_mutex_data, 0, sizeof(_mutex_data));
    _osMutexDef.mutex = _mutex_data;
#endif
    _osMutexId = osMutexCreate(&_osMutexDef);
    if (_osMutexId == NULL) {
        error("Error initializing the mutex object\n");
    }
}

osStatus Mutex::lock(uint32_t millisec) {
    return osMutexWait(_osMutexId, millisec);
}

bool Mutex::trylock() {
    return (osMutexWait(_osMutexId, 0) == osOK);
}

osStatus Mutex::unlock() {
    return osMutexRelease(_osMutexId);
}

Mutex::~Mutex() {
    osMutexDelete(_osMutexId);
}

}

Why include this? Missing mbed_error.h. please confirm this RTOS build.

Question relating to:

Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard. cmsis, rtos, RTX

I find this problem. RtosTimer.cpp,Mutex.cpp,Thread.cpp,RTX_CM_lib.cpp,Queue.cpp is changed newer RTOS lib is mbed_error.h. please include on RTOS lib in mbed_error.h header file. I try to old code to error.h is normal compile status.

posted by Kazu Zamasu 08 Jul 2014

it does not seem to be resolved yet. Had to include mbed-src to go beyond the compiling issue in my proyect.

posted by julian C 17 Aug 2014

still not fixed, had to create a separate file mbed_error.h and include error.h

posted by Mel Lau 30 Apr 2015

still not fixed in 2016

posted by James Lam 07 Apr 2016

... and we are still waiting 3th of may 2016

posted by Just Nielsen 03 May 2016

1 Answer

9 years, 9 months ago.

Hello,

thanks for reporting! mbed lib does not include this renaming of error header file yet, we are going to fix this soon.

Regards,
0xc0170

Accepted Answer

Should be fixed now ;)

posted by Martin Kojtal 08 Jul 2014