2020-12-01 18:16:10 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 Freie Universität Berlin,
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup tests
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief testing msg_queue_print
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Julian Holzwarth <julian.holzwarth@fu-berlin.de>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include "msg.h"
|
|
|
|
|
|
|
|
#define QUEUE_SIZE 8
|
|
|
|
|
|
|
|
msg_t msg_queue[QUEUE_SIZE];
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
msg_t messages[QUEUE_SIZE];
|
|
|
|
|
|
|
|
msg_queue_print();
|
|
|
|
msg_init_queue(msg_queue, QUEUE_SIZE);
|
|
|
|
msg_queue_print();
|
|
|
|
|
2024-01-11 13:16:17 +01:00
|
|
|
for (uintptr_t i = 0; i < QUEUE_SIZE; i++) {
|
2020-12-01 18:16:10 +01:00
|
|
|
messages[i].type = i;
|
2024-01-11 13:16:17 +01:00
|
|
|
messages[i].content.ptr = (void *) i;
|
2020-12-01 18:16:10 +01:00
|
|
|
msg_send_to_self(&messages[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
msg_queue_print();
|
2021-06-04 09:50:19 +02:00
|
|
|
puts("DONE");
|
2020-12-01 18:16:10 +01:00
|
|
|
return 0;
|
|
|
|
}
|