INF2004-Project v0.1
 
Loading...
Searching...
No Matches
pico_pathfinding_tests.c File Reference

This file contains the mapping and pathfinding tests to be run on the Pico depending on the input over serial. More...

#include <stdio.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include "pico/stdlib.h"
#include "pico/stdio.h"
#include "pico/platform.h"
#include "pico/time.h"
#include "pathfinding/maze.h"
#include "pathfinding/dfs.h"
#include "pathfinding/floodfill.h"
#include "pathfinding/a_star.h"
Include dependency graph for pico_pathfinding_tests.c:

Macros

#define DEBUG_PRINT(...)   printf(__VA_ARGS__)
 Debug print macro. Only prints if NDEBUG is not defined. More...
 
#define PICO_DEBUG_MALLOC   1
 Enables malloc debug.
 

Enumerations

enum  constants_t {
  GRID_ROWS = 6 , GRID_COLS = 4 , TEST_BUFFER_SIZE = 2048u , INITIALISE_WAIT = 5000u ,
  GRID_ROWS = 5 , GRID_COLS = 5 , GRID_ROWS = 5 , GRID_COLS = 5 ,
  GRID_ROWS = 10 , GRID_COLS = 10
}
 Constants used in the tests. More...
 

Functions

int main (void)
 Runs the tests based on user input. More...
 

Detailed Description

This file contains the mapping and pathfinding tests to be run on the Pico depending on the input over serial.

Author
Christopher Kok (chris.nosp@m.@for.nosp@m.celig.nosp@m.htni.nosp@m.ng.xy.nosp@m.z)
Version
0.1
Date
2023-11-26

Macro Definition Documentation

◆ DEBUG_PRINT

#define DEBUG_PRINT (   ...)    printf(__VA_ARGS__)

Debug print macro. Only prints if NDEBUG is not defined.

Parameters
...Variable arguments to be printed.
Note
This macro is only defined if NDEBUG is not defined.

Enumeration Type Documentation

◆ constants_t

Constants used in the tests.

Enumerator
GRID_ROWS 

Number of rows in the grid.

GRID_COLS 

Number of columns in the grid.

TEST_BUFFER_SIZE 

Size of the test buffer for serialisation.

INITIALISE_WAIT 

Time to wait for the user to open the serial terminal.

GRID_ROWS 

Number of rows in the grid.

GRID_COLS 

Number of columns in the grid.

GRID_ROWS 

Number of rows in the grid.

GRID_COLS 

Number of columns in the grid.

GRID_ROWS 

Number of rows in the grid.

GRID_COLS 

Number of columns in the grid.

Function Documentation

◆ main()

int main ( void  )

Runs the tests based on user input.

Returns
int 0 when exiting the main loop.

References INITIALISE_WAIT.