Permalink
Browse files

Merge branch 'pr_46'

Make the blinking more distinctive.

Closes #46
  • Loading branch information...
szszszsz committed Jun 15, 2018
2 parents fff9785 + 0e1e1de commit 664c11b3e6429551f1b21534efd8ae364047fa87
Showing with 11 additions and 11 deletions.
  1. +3 −3 src/hw_config.c
  2. +4 −4 src/inc/hw_config.h
  3. +2 −2 src/keyboard/report_protocol.c
  4. +2 −2 src/stm/stm32f10x_it.c
@@ -253,17 +253,17 @@ void ClearAllBlinking(){
SwitchSmartcardLED(DISABLE);
}

void StartBlinkingOATHLED (uint8_t times)
void StartBlinkingOATHLED(uint16_t times)
{
blinkOATH.timesLeft = times;
}

void VerifyBlinkError(uint8_t times)
void VerifyBlinkError(uint16_t times)
{
blinkVerifyError.timesLeft = times;
}

void VerifyBlinkCorrect(uint8_t times)
void VerifyBlinkCorrect(uint16_t times)
{
blinkVerifyCorrect.timesLeft = times;
}
@@ -42,7 +42,7 @@ typedef struct {
uint16_t ledOnInterval;
uint16_t ledOffInterval;
void (*ledSwitcher)(FunctionalState);
uint8_t timesLeft;
uint16_t timesLeft;
} Blink;

/* Exported functions ------------------------------------------------------- */
@@ -72,9 +72,9 @@ void SwitchOATHLED (FunctionalState NewState);


void ClearAllBlinking(void);
void StartBlinkingOATHLED (uint8_t times);
void VerifyBlinkError(uint8_t times);
void VerifyBlinkCorrect(uint8_t times);
void StartBlinkingOATHLED(uint16_t times);
void VerifyBlinkError(uint16_t times);
void VerifyBlinkCorrect(uint16_t times);

void DisableFirmwareDownloadPort (void);

@@ -436,9 +436,9 @@ void wink_correct(bool correct){
ClearAllBlinking();

if (correct){
VerifyBlinkCorrect(10);
VerifyBlinkCorrect(20);
} else {
VerifyBlinkError(10);
VerifyBlinkError(10000);
}
}

@@ -235,7 +235,7 @@ void SDIO_IRQHandler (void)
// =============================================================================
// TIM2 Interrupt Handler
// =============================================================================
uint8_t Blink_process(Blink *blink);
uint16_t Blink_process(Blink *blink);

void TIM2_IRQHandler (void)
{
@@ -254,7 +254,7 @@ void TIM2_IRQHandler (void)
}


uint8_t Blink_process(Blink *blink){
uint16_t Blink_process(Blink *blink){
if (blink->timesLeft <= 0) {
return 0;
}

0 comments on commit 664c11b

Please sign in to comment.