Index: embios/branches/4g_compat/init.c |
— | — | @@ -23,14 +23,23 @@ |
24 | 24 |
|
25 | 25 | #include "global.h"
|
26 | 26 | #include "lcdconsole.h"
|
| 27 | +#include "console.h"
|
| 28 | +#include "accel.h"
|
27 | 29 |
|
| 30 | +static const char welcomestring[] INITCONST_ATTR = "emBIOS v" VERSION "\n";
|
| 31 | +
|
28 | 32 | void init() INITCODE_ATTR;
|
29 | 33 | void init()
|
30 | 34 | {
|
31 | 35 | lcdconsole_init();
|
32 | | - lcdconsole_puts("emBIOS v" VERSION "\n\nStorage init...", 0, -1);
|
33 | | - lcdconsole_update();
|
34 | | - if (fat32_init()) lcdconsole_puts(" failed!\n", 0, -1);
|
35 | | - else lcdconsole_puts(" done\n", 0, -1);
|
36 | | - lcdconsole_update();
|
37 | | -} |
\ No newline at end of file |
| 36 | + cputs(1, welcomestring);
|
| 37 | + while(1)
|
| 38 | + {
|
| 39 | + uint8_t x = accel_get_axis(0);
|
| 40 | + uint8_t y = accel_get_axis(1);
|
| 41 | + uint8_t z = accel_get_axis(2);
|
| 42 | + cprintf(1, "x:%d y:%d z:%d\n", x, y, z);
|
| 43 | + }
|
| 44 | + // Never works so just comment it out:
|
| 45 | + //if (fat32_init()) cputs(1, "fat32_init() failed!\n");
|
| 46 | +}
|
Index: embios/branches/4g_compat/target/ipodnano4g/accel.c |
— | — | @@ -29,8 +29,3 @@ |
30 | 30 | uint8_t address = 0x29 + 2 * axis; |
31 | 31 | return i2crecvbyte(0x3a, address); |
32 | 32 | } |
33 | | - |
34 | | -float accel_get_axis_in_gs(uint8_t axis) |
35 | | -{ |
36 | | - return accel_get_axis(axis) / 16; |
37 | | -} |
Index: embios/branches/4g_compat/target/ipodnano4g/accel.h |
— | — | @@ -27,6 +27,5 @@ |
28 | 28 | #include "global.h" |
29 | 29 | |
30 | 30 | uint8_t accel_get_axis(uint8_t axis); |
31 | | -uint8_t accel_get_axis_in_gs(uint8_t axis); |
32 | 31 | |
33 | 32 | #endif |
Index: embios/branches/4g_compat/lcdconsole.c |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | current_col = -1;
|
50 | 50 | }
|
51 | 51 |
|
52 | | -void lcdconsole_putc(char string, int fgcolor, int bgcolor)
|
| 52 | +void lcdconsole_putc_noblit(char string, int fgcolor, int bgcolor)
|
53 | 53 | {
|
54 | 54 | if (string == '\r') return;
|
55 | 55 | current_col++;
|
— | — | @@ -81,9 +81,9 @@ |
82 | 82 | fgcolor, bgcolor, string, LINEBYTES);
|
83 | 83 | }
|
84 | 84 |
|
85 | | -void lcdconsole_puts(const char* string, int fgcolor, int bgcolor)
|
| 85 | +void lcdconsole_puts_noblit(const char* string, int fgcolor, int bgcolor)
|
86 | 86 | {
|
87 | | - while (*string) lcdconsole_putc(*string++, fgcolor, bgcolor);
|
| 87 | + while (*string) lcdconsole_putc_noblit(*string++, fgcolor, bgcolor);
|
88 | 88 | }
|
89 | 89 |
|
90 | 90 | void lcdconsole_update()
|
— | — | @@ -90,3 +90,15 @@ |
91 | 91 | {
|
92 | 92 | displaylcd(0, LCD_WIDTH - 1, 0, LCD_HEIGHT - 1, framebuf, 0);
|
93 | 93 | }
|
| 94 | +
|
| 95 | +void lcdconsole_putc(char string, int fgcolor, int bgcolor)
|
| 96 | +{
|
| 97 | + lcdconsole_putc_noblit(string, fgcolor, bgcolor);
|
| 98 | + lcdconsole_update();
|
| 99 | +}
|
| 100 | +
|
| 101 | +void lcdconsole_puts(const char* string, int fgcolor, int bgcolor)
|
| 102 | +{
|
| 103 | + while (*string) lcdconsole_putc_noblit(*string++, fgcolor, bgcolor);
|
| 104 | + lcdconsole_update();
|
| 105 | +}
|
Index: embios/branches/4g_compat/lcdconsole.h |
— | — | @@ -39,6 +39,8 @@ |
40 | 40 | void lcdconsole_init();
|
41 | 41 | void lcdconsole_putc(char string, int fgcolor, int bgcolor) ICODE_ATTR;
|
42 | 42 | void lcdconsole_puts(const char* string, int fgcolor, int bgcolor) ICODE_ATTR;
|
| 43 | +void lcdconsole_putc_noblit(char string, int fgcolor, int bgcolor) ICODE_ATTR;
|
| 44 | +void lcdconsole_puts_noblit(const char* string, int fgcolor, int bgcolor) ICODE_ATTR;
|
43 | 45 | void lcdconsole_update() ICODE_ATTR;
|
44 | 46 |
|
45 | 47 |
|