Replaced LED with more generic class GPIO

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@233 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-04 14:18:33 +00:00
parent 8b315602e9
commit cf0435c273
9 changed files with 172 additions and 93 deletions

View File

@@ -31,7 +31,6 @@
#include <stdio.h>
#include "Logger.h"
#include "led.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
@@ -95,7 +94,6 @@ caddr_t _sbrk(int incr)
// Stack overflow hook
void vApplicationStackOverflowHook(xTaskHandle xTask, signed portCHAR* pcTaskName)
{
LED_turnOn(ledGreen);
LOGGER_ERROR("STACK OVERFLOW IN TASK %s", pcTaskName);
}

View File

@@ -45,9 +45,9 @@
#include "platform.h"
#include "adc.h"
#include "gpio.h"
#include "IODevice.h"
#include "keypadMatrix.h"
#include "led.h"
#include "PCBA.h"
#include "uart.h"
#include "spi.h"
@@ -68,7 +68,7 @@ tick hook. */
struct LedTaskArguments
{
struct Led* led;
struct Gpio* led;
int frequency;
};
@@ -158,8 +158,8 @@ static ErrorStatus systeminfoCommandHandler(void)
OS_logTaskInfo(ledTaskHandle);
vTaskDelay(100);
OS_logTaskInfo(sysTaskHandle);
vTaskDelay(100);
OS_logTaskInfo(display->taskHandle);
// vTaskDelay(100);
// OS_logTaskInfo(display->taskHandle);
return errorStatus;
}
@@ -168,9 +168,9 @@ static void initTask(void* parameters)
{
initPlatform();
xTaskCreate(ledBlinkTask, (const char* const)"ledTask", 40, &ledTaskArguments, 0, &ledTaskHandle);
xTaskCreate(ledBlinkTask, (const char* const)"ledTask", 50, &ledTaskArguments, 0, &ledTaskHandle);
Logger_construct(&uart3->device);
Logger_construct(&uart1->device);
NHD0420_construct(&nhd0420, &spiDisplay->device);
@@ -203,13 +203,13 @@ static void ledBlinkTask (void* parameters)
char high = 1;
char low = 0;
struct LedTaskArguments* arguments = (struct LedTaskArguments*) parameters;
struct Led* led = arguments->led;
struct Gpio* gpio = arguments->led;
int frequency = arguments->frequency;
while (1)
{
IODevice_write(&led->device, &high, 1);
IODevice_write(&gpio->device, &high, 1);
vTaskDelay(configTICK_RATE_HZ / (frequency * 2));
IODevice_write(&led->device, &low, 1);
IODevice_write(&gpio->device, &low, 1);
vTaskDelay(configTICK_RATE_HZ / (frequency * 2));
}
}

View File

@@ -39,7 +39,6 @@
#include "Display.h"
#include "Logger.h"
#include "led.h"
#include "platform.h"
#include "rtc.h"
#include "spi.h"