fix interrupt handler

This commit is contained in:
Alwin Berger 2023-03-01 08:53:01 +01:00
parent fc20f2202f
commit 6789bf2af6

View File

@ -127,12 +127,12 @@ void main_micro_int( void )
mainREPLICA_C_TASK_PRIORITY, /* The priority assigned to the task. */
&xReplC ); /* The task handle is not required, so NULL is passed. */
xTaskCreate( prvSpor, /* The function that implements the task. */
"Spor", /* The text name assigned to the task - for debug only as it is not used by the kernel. */
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */
NULL, /* The parameter passed to the task - not used in this case. */
mainREPLICA_SPOR_TASK_PRIORITY, /* The priority assigned to the task. */
NULL ); /* The task handle is not required, so NULL is passed. */
// xTaskCreate( prvSpor, /* The function that implements the task. */
// "Spor", /* The text name assigned to the task - for debug only as it is not used by the kernel. */
// configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */
// NULL, /* The parameter passed to the task - not used in this case. */
// mainREPLICA_SPOR_TASK_PRIORITY, /* The priority assigned to the task. */
// NULL ); /* The task handle is not required, so NULL is passed. */
/* Start the tasks and timer running. */
vTaskStartScheduler();
@ -186,22 +186,24 @@ static void prvReplicaC( void * pvParameters )
}
static void prvSpor( void * pvParameters )
{
uint32_t x = fuzz_char_next();
TickType_t xLastWakeTime = xTaskGetTickCount();
const TickType_t xFrequency = 7 / portTICK_PERIOD_MS;
TickType_t xFrequency = x / portTICK_PERIOD_MS;
vTaskDelayUntil( &xLastWakeTime, xFrequency );
while (1)
{
puts("Fire");
xTaskNotifyGive(xReplB);
vTaskDelayUntil( &xLastWakeTime, xFrequency * 10000 );
ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
}
}
void isr_starter( void )
{
puts("Fire");
xTaskNotifyGive(xReplB);
if (xReplB) {
vTaskNotifyGiveFromISR(xReplB, NULL);
}
}
/*-----------------------------------------------------------*/