Commit 371108a6 authored by Matthias Wenzl's avatar Matthias Wenzl
Browse files

cleanup

parent 00ddb545
......@@ -126,7 +126,7 @@
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="TM4C1294XL"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="uip"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="uip_hw-adapted"/>
<entry excluding="tm4c1294ncpdt.cmd|TM4C1294XL|uip|uip_hw-adapted|lib" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
<entry excluding="blinkit.c|tm4c1294ncpdt.cmd|TM4C1294XL|uip|uip_hw-adapted|lib" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
......
......@@ -41,7 +41,6 @@
#include <server.h>
#include <client.h>
#include <blinkit.h>
#include <UIP_Task.h>
......@@ -69,10 +68,6 @@ int main(void)
(void) setup_UIP_Task(ui32SysClock);
System_printf("Created UIP Task\n");
/*Initialize Clock for Periodic blinking */
setup_blink_Task();
System_printf("Created blink Task\n");
/* SysMin will only print to the console upon calling flush or exit */
......
/*
* blinkit.c
*
* Created on: 12.11.2014
* Author: kramer
*/
#include "blinkit.h"
#include "inc/tm4c1294ncpdt.h"
#include <driverlib/gpio.h>
#include <driverlib/pin_map.h>/*supplies GPIO_PIN_x*/
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Event.h>
#include <ti/sysbios/knl/Task.h>
#define CLOCKTICK_LED_EVENT 1
static Event_Handle Event_Clock_LED;
void BlinkLedClock_ClkFn(UArg arg) {
Event_post(Event_Clock_LED,CLOCKTICK_LED_EVENT);
}
void Blink_TaskFXN (UArg arg0, UArg arg1)
{
Clock_Handle clkhndl;
Clock_Params clkParams;
Error_Block eb;
// Inits go here
Error_init(&eb);
Event_Clock_LED = Event_create(NULL,&eb);
if (Event_Clock_LED == NULL) {
System_abort("Event create failed");
}
Clock_Params_init(&clkParams);
clkParams.period = 500; //Blink-Frequency 1 HZ
clkParams.startFlag = TRUE;
clkhndl=Clock_create(BlinkLedClock_ClkFn, 500, &clkParams, &eb);
if (clkhndl == NULL) {
System_abort("Clock create failed");
}
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0);
GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0,0);//led is initially off
// and now the endless Loop
for (;;)
{
Event_pend(Event_Clock_LED,0 ,CLOCKTICK_LED_EVENT, BIOS_WAIT_FOREVER);
GPIO_PORTN_DATA_R ^= (0x01);
Task_yield();
}
}
void setup_blink_Task(void) {
//start led pattern generator
Error_Block eb;
Task_Params Params_Blink_Task;
Task_Handle Handle_Blink_Task;
Error_init(&eb);
Task_Params_init(&Params_Blink_Task);
Params_Blink_Task.stackSize = 512;//stack in bytes
Params_Blink_Task.priority = 15;//15 is default 16 is highest priority -> see RTOS configuration
Handle_Blink_Task = Task_create((Task_FuncPtr)Blink_TaskFXN, &Params_Blink_Task, &eb);
if (Handle_Blink_Task == NULL) {
System_abort("Task create failed");
}
}
/* blinkit.h
*
* Created on: Nov 12, 2014
* Author: kramer
*/
#ifndef BLINKIT_H_
#define BLINKIT_H_
#endif /* BLINKIT_H_ */
#include <stdint.h>
#include <stdbool.h>
#include <inc/hw_memmap.h>
#include <ti/drivers/GPIO.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/hal/Timer.h>
#include <ti/sysbios/knl/Clock.h>
#include <driverlib/sysctl.h>
void setup_blink_Task(void);
void BlinkLedClock_ClkFn(UArg arg);
void Blink_TaskFXN (UArg arg0, UArg arg1);
#
# This file was generated based on the configuration script:
# /home/matthias/git/voip-phone/src/application.cfg
# /home/matthias/git/connected_launchpad_rtos_uip/application.cfg
#
# This makefile may be included in other makefiles that need to build
# the libraries containing the compiled source files generated as
......@@ -14,7 +14,7 @@
#
# The absolute path to the generated source directory (at the time the
# sources were generated) is:
# /home/matthias/git/voip-phone/src/src
# /home/matthias/git/connected_launchpad_rtos_uip/src
#
GEN_SRC_DIR ?= ../src
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment