summaryrefslogtreecommitdiffstats
path: root/Src/osmolib/src/target/firmware/apps/hello_world/main.c
diff options
context:
space:
mode:
authorroot2012-02-28 14:15:19 +0100
committerroot2012-02-28 14:15:19 +0100
commit1116885d96725ce064db04604e4d197a136b163c (patch)
tree22ba472d309f1ac66918f09cc63bb9be057cf579 /Src/osmolib/src/target/firmware/apps/hello_world/main.c
parentcompiled version added (diff)
downloadimsi-catcher-detection-1116885d96725ce064db04604e4d197a136b163c.tar.gz
imsi-catcher-detection-1116885d96725ce064db04604e4d197a136b163c.tar.xz
imsi-catcher-detection-1116885d96725ce064db04604e4d197a136b163c.zip
updated codebase to latest version of osmocombb
Diffstat (limited to 'Src/osmolib/src/target/firmware/apps/hello_world/main.c')
-rw-r--r--Src/osmolib/src/target/firmware/apps/hello_world/main.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/Src/osmolib/src/target/firmware/apps/hello_world/main.c b/Src/osmolib/src/target/firmware/apps/hello_world/main.c
index 5e3ed85..cdf4dae 100644
--- a/Src/osmolib/src/target/firmware/apps/hello_world/main.c
+++ b/Src/osmolib/src/target/firmware/apps/hello_world/main.c
@@ -31,7 +31,6 @@
#include <keypad.h>
#include <board.h>
#include <abb/twl3025.h>
-#include <display.h>
#include <rf/trf6151.h>
#include <calypso/clock.h>
#include <calypso/tpu.h>
@@ -41,6 +40,7 @@
#include <calypso/misc.h>
#include <comm/sercomm.h>
#include <comm/timer.h>
+#include <fb/framebuffer.h>
/* Main Program */
const char *hr = "======================================================================\n";
@@ -55,7 +55,6 @@ static void console_rx_cb(uint8_t dlci, struct msgb *msg)
}
printf("Message on console DLCI: '%s'\n", msg->data);
- display_puts((char *) msg->data);
msgb_free(msg);
}
@@ -89,6 +88,30 @@ int main(void)
calypso_clk_dump();
puts(hr);
+ fb_clear();
+
+ fb_setfg(FB_COLOR_BLACK);
+ fb_setbg(FB_COLOR_WHITE);
+ fb_setfont(FB_FONT_HELVB14);
+
+ fb_gotoxy(2,20);
+ fb_putstr("Hello World!",framebuffer->width-4);
+
+ fb_setfg(FB_COLOR_RED);
+ fb_setbg(FB_COLOR_BLUE);
+
+ fb_gotoxy(2,25);
+ fb_boxto(framebuffer->width-3,38);
+
+ fb_setfg(FB_COLOR_WHITE);
+ fb_setfont(FB_FONT_HELVR08);
+ fb_gotoxy(8,33);
+ fb_putstr("osmocom-bb",framebuffer->width-4);
+
+ fb_flush();
+
+
+
/* Dump all memory */
//dump_mem();
#if 0
@@ -97,16 +120,13 @@ int main(void)
puts(hr);
#endif
- display_set_attr(DISP_ATTR_INVERT);
- display_puts("Hello World");
-
sercomm_register_rx_cb(SC_DLCI_CONSOLE, console_rx_cb);
sercomm_register_rx_cb(SC_DLCI_L1A_L23, l1a_l23_rx_cb);
/* beyond this point we only react to interrupts */
puts("entering interrupt loop\n");
while (1) {
- update_timers();
+ osmo_timers_update();
}
twl3025_power_off();
@@ -132,16 +152,13 @@ void key_handler(enum key_codes code, enum key_states state)
case KEY_7:
case KEY_8:
case KEY_9:
- sprintf(test, "%d", code - KEY_0);
- display_puts(test);
+ // used to be display_puts...
break;
case KEY_STAR:
- sprintf(test, "*", 0);
- display_puts(test);
+ // used to be display puts...
break;
case KEY_HASH:
- sprintf(test, "#", 0);
- display_puts(test);
+ // used to be display puts...
break;
default:
break;