stanardize kernel/util

This commit is contained in:
Amrit Panesar committed 2016-10-24 20:34:31 -07:00
1 parent 329c593a9c
commit 5567984cad
6 files changed
+33 -60

No files matched your search

+12 -1
View File
@@ -1,5 +1,5 @@
/**
arm-016-util.c
util.c
*/
#include "util.h"
@@ -40,8 +40,19 @@ void setColor(volatile unsigned char* fb, colour_t pixel, long x, long y, long p
}
}
double sin(double x)
{
double x2 = x * x;
if (x < PI)
return (((((-0.0000000205342856289746600727*x2 + 0.00000270405218307799040084)*x2 - 0.000198125763417806681909)*x2 + 0.00833255814755188010464)*x2 - 0.166665772196961623983)*x2 + 0.999999707044156546685)*x;
else if (x <= PI * 2) return (-sin(x - PI));
while (x > PI * 2)
x -= PI * 2;
return sin(x);
}
+4 -8
View File
@@ -3,12 +3,10 @@ arm-016-util.h
*/
#ifndef arm_016_util
#define arm_016_util
#ifndef RPI_UTIL_H
#define RPI_UTIL_H
#define PI 3.14159265359
#include "image_data.h"
#define SCREEN_WIDTH 1920
#define SCREEN_HEIGHT 1080
#define SCREEN_DEPTH 24 /* 16 or 32-bit */
@@ -23,9 +21,7 @@ typedef struct {
} colour_t;
//extern double pow(double, int);
//extern double sin(double);
extern void setColor(volatile unsigned char* fb, colour_t pixel, long x, long y, long pitch);
extern double sin(double in);
#endif
-1
View File
@@ -109,7 +109,6 @@ void __attribute__((interrupt("ABORT"))) data_abort_vector(void)
*/
void __attribute__((interrupt("IRQ"))) interrupt_vector(void)
{
static int lit = 0;
static int ticks = 0;
static int seconds = 0;