Trammell Hudson avatar Trammell Hudson committed 2d7e286 Draft

random fixes

Comments (0)

Files changed (3)

 #include "bits.h"
 #include "clock.h"
 
-volatile uint8_t now_hour = 15;
-volatile uint8_t now_min = 53;
+volatile uint8_t now_hour = 20;
+volatile uint8_t now_min = 06;
 volatile uint8_t now_sec = 0;
 volatile uint16_t now_ms;
 volatile uint16_t now; // ms since boot
 	} while (x != 0);
 }
 
-#include "images/adafruit.xbm"
+#include "images/samson.xbm"
 
 
 static void
-draw_hms(void)
+draw_hms(
+	uint8_t cx,
+	uint8_t cy
+)
 {
 	cli();
 	uint16_t ms = now_ms;
 	uint8_t s = now_sec;
 	sei();
 
-	const uint8_t cx = 0;
-	const uint8_t cy = 0;
-
 	draw_digit_big( 0+cx, cy, h / 10);
 	draw_digit_big(16+cx, cy, h % 10);
 	draw_digit_big(40+cx, cy, m / 10);
 static void
 analog_clock(void)
 {
-	draw_image(image_bits);
-	draw_hms();
-	return;
-
 	// Draw all the digits around the outside
-	for (uint8_t h = 0 ; h < 24 ; h++)
+	for (uint8_t h = 0 ; h < 24 ; h += 1)
 	{
 		uint16_t h2 = h;
 		h2 = (h2 * 682) / 64;
 	while (1)
 	{
 		if (0)
+		{
 			planet_loop();
-		else
+			draw_hms(64, now_min*4);
+		} else
+		if (0)
+		{
+			draw_image(image_bits);
+			draw_hms(0,0);
+		} else {
 			analog_clock();
+		}
 	}
 }
 
 
 #include <stdint.h>
 
+
+static inline void
+vector_x(
+	uint8_t x
+)
+{
+	PORTB = x;
+}
+
+static  inline void
+vector_y(
+	uint8_t y
+)
+{
+	PORTD = y;
+}
+
+
+static inline void
+vector_init(void)
+{
+	DDRD = 0xFF;
+	DDRB = 0xFF;
+	vector_x(128);
+	vector_y(128);
+}
+
+
 void
 line_vert(
 	uint8_t x0,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.