Make examples friendlier for non GCC compilers and fixed slave_mem_i2c.c to compile on boards without I2C pins (#336)
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
|
||||
#define SERIAL_CLK_DIV 1.f
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
// Format: cmd length (including cmd byte), post delay in units of 5 ms, then cmd payload
|
||||
// Note the delays have been shortened a little
|
||||
static const uint8_t st7789_init_seq[] = {
|
||||
@@ -130,8 +134,8 @@ int main() {
|
||||
if (theta > theta_max)
|
||||
theta -= theta_max;
|
||||
int32_t rotate[4] = {
|
||||
cosf(theta) * (1 << UNIT_LSB), -sinf(theta) * (1 << UNIT_LSB),
|
||||
sinf(theta) * (1 << UNIT_LSB), cosf(theta) * (1 << UNIT_LSB)
|
||||
(int32_t) (cosf(theta) * (1 << UNIT_LSB)), (int32_t) (-sinf(theta) * (1 << UNIT_LSB)),
|
||||
(int32_t) (sinf(theta) * (1 << UNIT_LSB)), (int32_t) (cosf(theta) * (1 << UNIT_LSB))
|
||||
};
|
||||
interp0->base[0] = rotate[0];
|
||||
interp0->base[1] = rotate[2];
|
||||
|
||||
Reference in New Issue
Block a user