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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user