* We have UART1-4 (from UARTN, UART0 handling is different.) * Added Fmutex * Removed movable pins. * Disabled handshakes. (Not sure how to configure those.) * 1 and 4, as well as 2 and 3 share their interrupts with each other. (Again, not sure how it should work.)
29 lines
392 B
C++
29 lines
392 B
C++
/*
|
|
* Fmutex.cpp
|
|
*
|
|
* Created on: 15.8.2017
|
|
* Author: krl
|
|
*/
|
|
|
|
#include "Fmutex.h"
|
|
|
|
Fmutex::Fmutex() {
|
|
// TODO Auto-generated constructor stub
|
|
mutex = xSemaphoreCreateMutex();
|
|
}
|
|
|
|
Fmutex::~Fmutex() {
|
|
// TODO Auto-generated destructor stub
|
|
vSemaphoreDelete(mutex);
|
|
}
|
|
|
|
void Fmutex::lock()
|
|
{
|
|
xSemaphoreTake(mutex, portMAX_DELAY);
|
|
}
|
|
|
|
void Fmutex::unlock()
|
|
{
|
|
xSemaphoreGive(mutex);
|
|
}
|