Commits

Trammell Hudson committed a04385a

Include remaining time

  • Participants
  • Parent commits 41c5ac8

Comments (0)

Files changed (1)

 
 
 static char time_buffer[32];
-static char otp_buffer[8];
+static char otp_buffer[16];
 static Window window;
 static TextLayer time_layer;
 static TextLayer otp_layer;
 */
 	const uint32_t now = unix_epoch_time(ptm) + 3600 * GMT_OFFSET;
 	uint32_t auth = oauth_calc(now);
-	otp_buffer[6] = 0;
+	uint32_t rem = 30 - (now % 30);
+	otp_buffer[9] = 0;
+	otp_buffer[8] = '0' + rem % 10; rem /= 10;
+	otp_buffer[7] = '0' + rem % 10; rem /= 10;
+	otp_buffer[6] = ' ';
 	otp_buffer[5] = '0' + auth % 10; auth /= 10;
 	otp_buffer[4] = '0' + auth % 10; auth /= 10;
 	otp_buffer[3] = '0' + auth % 10; auth /= 10;