Misc helpers for device drivers.
More...
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "math/m_api.h"
#include "util/u_device.h"
#include "util/u_misc.h"
|
#define | PRINT(...) fprintf(stderr, __VA_ARGS__) |
|
#define | PRINT_STR(name, val) PRINT("\t%s = %s\n", name, val) |
|
#define | PRINT_INT(name, val) PRINT("\t%s = %u\n", name, val) |
|
#define | PRINT_MM(name, val) |
|
#define | PRINT_ANGLE(name, val) PRINT("\t%s = %f (%i°)\n", name, val, (int32_t)(val * (180 / M_PI))) |
|
#define | PRINT_MAT2X2(name, rot) |
|
Misc helpers for device drivers.
- Author
- Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
◆ PRINT_MAT2X2
#define PRINT_MAT2X2 |
( |
|
name, |
|
|
|
rot |
|
) |
| |
Value:PRINT("\t%s = {%f, %f} {%f, %f}\n", name, rot.v[0], rot.v[1], \
rot.v[2], rot.v[3])
◆ PRINT_MM
#define PRINT_MM |
( |
|
name, |
|
|
|
val |
|
) |
| |
Value:PRINT("\t%s = %f (%i.%02imm)\n", name, val, (int32_t)(val * 1000.f), \
abs((int32_t)(val * 100000.f)) % 100)
◆ u_device_rotation_180
Initial value:= {{
.vecs =
{
{-1, 0},
{0, -1},
},
}}
◆ u_device_rotation_ident
Initial value:= {{
.vecs =
{
{1, 0},
{0, 1},
},
}}
◆ u_device_rotation_left
Initial value:= {{
.vecs =
{
{0, -1},
{1, 0},
},
}}
◆ u_device_rotation_right
Initial value:= {{
.vecs =
{
{0, 1},
{-1, 0},
},
}}