Prusa MINI Firmware overview
|
Go to the documentation of this file.
24 #include "../core/serial.h"
32 #define FORCE_INLINE __attribute__((always_inline)) inline
33 #define _O3 __attribute__((optimize("O3")))
35 template <u
int8_t u
id, u
int8_t size>
38 template<
typename T,
typename Cfg>
42 static constexpr T signtest = -1;
43 static_assert(signtest < 0,
"Bresenham type must be signed!");
50 Bresenham(
const T &inDivisor=1,
const int8_t &inDir=1,
const T &inDividend=1,
const T &inValue=0) {
51 for (
uint8_t i = 0;
i < Cfg::SIZE;
i++)
init(
i, inDivisor, inDir, inDividend, inValue);
55 Bresenham(
const T &inDivisor,
const int8_t (&inDir)[Cfg::SIZE],
const T (&inDividend)[Cfg::SIZE],
const T (&inValue)[Cfg::SIZE]={0}) {
56 init(inDivisor, inDir, inDividend, inValue);
60 Bresenham(
const T &inDivisor,
const int8_t &inDir,
const T (&inDividend)[Cfg::SIZE],
const T (&inValue)[Cfg::SIZE]={0}) {
61 init(inDivisor, inDir, inDividend, inValue);
65 FORCE_INLINE static void init(
const uint8_t index,
const T &inDivisor=1,
const int8_t &inDir=1,
const T &inDividend=1,
const T &inValue=0) {
69 value[index] = inValue;
74 FORCE_INLINE static void init(
const T &inDivisor,
const int8_t (&inDir)[Cfg::SIZE],
const T (&inDividend)[Cfg::SIZE],
const T (&inValue)[Cfg::SIZE]={0}) {
85 FORCE_INLINE static void init(
const T &inDivisor,
const int8_t &inDir,
const T (&inDividend)[Cfg::SIZE],
const T (&inValue)[Cfg::SIZE]={0}) {
99 value[index] = inValue;
122 if (index < Cfg::SIZE) {
#define _O3
Definition: bresenham.h:33
static FORCE_INLINE bool tick1(const uint8_t index)
Definition: bresenham.h:108
#define SERIAL_CHAR(x)
Definition: serial.h:69
#define SERIAL_ECHO(x)
Definition: serial.h:70
static FORCE_INLINE void init(const T &inDivisor, const int8_t(&inDir)[Cfg::SIZE], const T(&inDividend)[Cfg::SIZE], const T(&inValue)[Cfg::SIZE]={0})
Definition: bresenham.h:74
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
static T dividend[Cfg::SIZE]
Definition: bresenham.h:43
uint8_t i
Definition: screen_test_graph.c:72
static constexpr uint8_t UID
Definition: bresenham.h:36
static void report(const uint8_t index)
Definition: bresenham.h:121
static T value[Cfg::SIZE]
Definition: bresenham.h:43
Bresenham(const T &inDivisor=1, const int8_t &inDir=1, const T &inDividend=1, const T &inValue=0)
Definition: bresenham.h:50
static T counter[Cfg::SIZE]
Definition: bresenham.h:43
static FORCE_INLINE void tick() _O3
Definition: bresenham.h:119
static FORCE_INLINE void tick1() _O3
Definition: bresenham.h:117
static FORCE_INLINE void prime(const uint8_t index)
Definition: bresenham.h:103
static FORCE_INLINE void tick(const uint8_t index)
Definition: bresenham.h:113
static T divisor
Definition: bresenham.h:43
static T dir[Cfg::SIZE]
Definition: bresenham.h:43
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
const uint8_t[]
Definition: 404_html.c:3
Bresenham(const T &inDivisor, const int8_t &inDir, const T(&inDividend)[Cfg::SIZE], const T(&inValue)[Cfg::SIZE]={0})
Definition: bresenham.h:60
static void report()
Definition: bresenham.h:131
static FORCE_INLINE void back(const uint8_t index)
Definition: bresenham.h:106
static FORCE_INLINE void prime()
Definition: bresenham.h:104
Definition: bresenham.h:36
static FORCE_INLINE void init(const T &inDivisor, const int8_t &inDir, const T(&inDividend)[Cfg::SIZE], const T(&inValue)[Cfg::SIZE]={0})
Definition: bresenham.h:85
static FORCE_INLINE void reinit(const uint8_t index, const int8_t &inDir=1, const T &inDividend=1, const T &inValue=0)
Definition: bresenham.h:96
static constexpr uint8_t SIZE
Definition: bresenham.h:36
#define FORCE_INLINE
Definition: bresenham.h:32
Definition: bresenham.h:39
static FORCE_INLINE void init(const uint8_t index, const T &inDivisor=1, const int8_t &inDir=1, const T &inDividend=1, const T &inValue=0)
Definition: bresenham.h:65
Bresenham(const T &inDivisor, const int8_t(&inDir)[Cfg::SIZE], const T(&inDividend)[Cfg::SIZE], const T(&inValue)[Cfg::SIZE]={0})
Definition: bresenham.h:55
static png_bytep size_t size
Definition: pngwrite.c:2170