Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /general libraries
- #include <stdlib.h>
- #include <string.h>
- //FreeRTOS
- #include "FreeRTOS.h"
- #include "task.h"
- #include "app_config.h"
- //target.h contains general initialization of MCU, LP2378 microcontroller
- #include "target.h"
- //general purpose I/O
- #include "gpio.h"
- //typedef sht_t* shtHANDLE;
- //shtHANDLE shth;
- portTASK_FUNCTION_PROTO(LEDTest, pvParameters);
- //uint8_t measureInd = 0;
- portTASK_FUNCTION(LEDTest, pvParameters)
- {
- portTickType xPrevTick = xTaskGetTickCount();
- while(1)
- {
- LED2_OFF();
- LED1_ON();
- vTaskDelayUntil(&xPrevTick, 500);
- }
- }
- portTASK_FUNCTION(LEDTest2, pvParameters)
- {
- portTickType xPrevTick2 = xTaskGetTickCount();
- while(1)
- {
- LED1_OFF();
- LED2_ON();
- vTaskDelayUntil(&xPrevTick2, 2000);
- }
- }
- int main()
- {
- //alustus funktio
- target_init();
- //luo taskin joka vilkuttaa lediä
- xTaskCreate((pdTASK_CODE)LEDTest, "LEDTEST", configMINIMAL_STACK_SIZE, NULL,
- (tskIDLE_PRIORITY + 2 ), ( xTaskHandle * )NULL);
- xTaskCreate((pdTASK_CODE)LEDTest2, "LEDTEST2", configMINIMAL_STACK_SIZE, NULL,
- (tskIDLE_PRIORITY + 1 ), ( xTaskHandle * )NULL);
- //aloittaa taskin suorittamisen
- vTaskStartScheduler();
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement