diff --git a/projekt_wyklad_6_freertos/main.c b/projekt_wyklad_6_freertos/main.c index d19f299..e84d3c7 100644 --- a/projekt_wyklad_6_freertos/main.c +++ b/projekt_wyklad_6_freertos/main.c @@ -286,6 +286,7 @@ int main(void) //{ // for(;;);// user code here //} +<<<<<<< HEAD // komentarz zdalna edycja 5 //ISR(BADISR_vect) @@ -303,4 +304,6 @@ int main(void) //ISR(BADISR_vect) //{ // for(;;);// user code here -//} \ No newline at end of file +//} +======= +>>>>>>> 271502b08d2c496d81b2476277453e44ad52af4b diff --git a/projekt_wyklad_6_freertos/main_BACKUP_923.c b/projekt_wyklad_6_freertos/main_BACKUP_923.c new file mode 100644 index 0000000..e84d3c7 --- /dev/null +++ b/projekt_wyklad_6_freertos/main_BACKUP_923.c @@ -0,0 +1,309 @@ +/* + * projekt_wyklad_3.c + * + * Created: 2020-10-10 09:45:33 + * Author : Zbyszek + */ + + +#include "sam.h" +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" + +unsigned long int ci=0, cp=0, ct=0, placebo=0; +char h1=0, h2=0; +TaskHandle_t xHandle1 = NULL, xHandle2 = NULL; +QueueHandle_t xQueue; +//TimerHandle_t xTimers[2/* NUM_TIMERS */]; + +/* Define an enumerated type used to identify the source of the data. */ +typedef enum +{ + eSender1, + eSender2 +} DataSource_t; +/* Define the structure type that will be passed on the queue. */ +typedef struct +{ + uint8_t ucValue; + DataSource_t eDataSource; +} Data_t; +/* Declare two variables of type Data_t that will be passed on the queue. */ +static const Data_t xStructsToSend[ 2 ] = +{ + { 100, eSender1 }, /* Used by Sender1. */ + { 200, eSender2 } /* Used by Sender2. */ +}; + +void vApplicationIdleHook( void ) +{ + ci++; +} + +void vApplicationTickHook( void ) +{ + long fh= xPortGetFreeHeapSize(); + //uxTaskGetStackHighWaterMark(&xHandle1); + //uxTaskGetStackHighWaterMark(&xHandle2); + ct++; +} + + +void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName ) +{ + for(;;); +} + +void vApplicationMallocFailedHook( void ) +{ + for(;;); +} + +void vApplicationDaemonTaskStartupHook( void ) +{ + ci=0; + cp=0; + ct=0; +} + + +void vTaskCode1( void * pvParameters ) +{ + unsigned char p = 1; //(unsigned char) pvParameters; + h1=1; + + // configASSERT( ( ( uint32_t ) pvParameters ) == 1 ); + + //PORTB=(1<>>>>>> 271502b08d2c496d81b2476277453e44ad52af4b diff --git a/projekt_wyklad_6_freertos/main_BASE_923.c b/projekt_wyklad_6_freertos/main_BASE_923.c new file mode 100644 index 0000000..092ad2e --- /dev/null +++ b/projekt_wyklad_6_freertos/main_BASE_923.c @@ -0,0 +1,282 @@ +/* + * projekt_wyklad_3.c + * + * Created: 2020-10-10 09:45:33 + * Author : Zbyszek + */ + + +#include "sam.h" +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" + +unsigned long int ci=0, cp=0, ct=0, placebo=0; +char h1=0, h2=0; +TaskHandle_t xHandle1 = NULL, xHandle2 = NULL; +QueueHandle_t xQueue; +//TimerHandle_t xTimers[2/* NUM_TIMERS */]; + +/* Define an enumerated type used to identify the source of the data. */ +typedef enum +{ + eSender1, + eSender2 +} DataSource_t; +/* Define the structure type that will be passed on the queue. */ +typedef struct +{ + uint8_t ucValue; + DataSource_t eDataSource; +} Data_t; +/* Declare two variables of type Data_t that will be passed on the queue. */ +static const Data_t xStructsToSend[ 2 ] = +{ + { 100, eSender1 }, /* Used by Sender1. */ + { 200, eSender2 } /* Used by Sender2. */ +}; + +void vApplicationIdleHook( void ) +{ + ci++; +} + +void vApplicationTickHook( void ) +{ + long fh= xPortGetFreeHeapSize(); + //uxTaskGetStackHighWaterMark(&xHandle1); + //uxTaskGetStackHighWaterMark(&xHandle2); + ct++; +} + + +void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName ) +{ + for(;;); +} + +void vApplicationMallocFailedHook( void ) +{ + for(;;); +} + +void vApplicationDaemonTaskStartupHook( void ) +{ + ci=0; + cp=0; + ct=0; +} + + +void vTaskCode1( void * pvParameters ) +{ + unsigned char p = 1; //(unsigned char) pvParameters; + h1=1; + + // configASSERT( ( ( uint32_t ) pvParameters ) == 1 ); + + //PORTB=(1<