xQueueHandle GlobaleQueuehandle2 = 0; GlobaleQueuehandle2 = xQueueCreate(10, sizeof(mt_t)); typedef struct merkletree { uint32t elems; mtalt *level[TREE_LEVELS]; } mt_t; void task1(void *vParameters){
while(1){
mt_t* mtree = mt_test_tree(leaf, pt->buffer);
vPortFree(pt);
vTaskDelay(3000);
if(!xQueueSend(Globale_Queue_handle2, (void *) &mtree, 1000)){
printf("Failed to send value to queue nr");
}
}
}
void task2(void *vParameters){
int choice_leaf;
while(1){
mt_integrity *mi = pvPortCalloc(1, sizeof(mt_integrity));
mt_t* mtree;
if(!xQueueReceive(Globale_Queue_handle2, &mtree, 2000 )) {
witness(choice_leaf, mi->wit_check, mtree);
vPortFree(mi);
}else{
printf("waiting for mtree from queue... nr");
}
}
}
`