Commits

Trammell Hudson  committed 2d7e286 Draft

random fixes

  • Participants
  • Parent commits ccedd29

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

File scopeclock.c

 	} 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,