Commits

Trammell Hudson committed 14238f8

manchester coding works! all bits correct

  • Participants
  • Parent commits ec088c4
  • Tags c-version-works

Comments (0)

Files changed (1)

 	const uint8_t n
 )
 {
-	delay(n-2);
 	asm(
 		"eor r16, r17\n"
 		"out 0x17, r16\n"
 	);
+
+	if (n > 2)
+		delay(n-2);
 }
 
 
 	//uint8_t startloop
 )
 {
-	//if (startloop)
-		//toggle(2);
-	//else
-		toggle(4);
-
+	toggle(4); // 4
 	toggle(4); // 8
 	toggle(4); // 12
 	toggle(4); // 16
 	//uint8_t startloop
 )
 {
-	//if (startloop)
-		//toggle(2);
-	//else
-		toggle(5);
-
+	toggle(5); //  5
 	toggle(5); // 10
 	toggle(5); // 15
 	toggle(5); // 20
 	const uint8_t x
 )
 {
-	if (x)
+	if (x & 1)
 	{
 		baseband_1();
 		baseband_0();
 hid_output(void)
 {
 	header();
+	asm("/* hid_mfg_code */\n");
 	manchester(HID_MFG_CODE, 20);
+	asm("/* hid_site_code */\n");
 	manchester(HID_SITE_CODE, 8);
+	asm("/* hid_unique_id */\n");
 	manchester(HID_UNIQUE_ID, 16);
+	asm("/* hid_parity */\n");
 	manchester(0, 1);
 }
 
 	while (1)
 		hid_output();
 }
-