Skip to content

Commit

Permalink
Merge branch 'pr_46'
Browse files Browse the repository at this point in the history
Make the blinking more distinctive.

Closes #46
  • Loading branch information
szszszsz committed Jun 15, 2018
2 parents fff9785 + 0e1e1de commit 664c11b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/hw_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions src/inc/hw_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef struct {
uint16_t ledOnInterval;
uint16_t ledOffInterval;
void (*ledSwitcher)(FunctionalState);
uint8_t timesLeft;
uint16_t timesLeft;
} Blink;

/* Exported functions ------------------------------------------------------- */
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/keyboard/report_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ void wink_correct(bool correct){
ClearAllBlinking();

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

Expand Down
4 changes: 2 additions & 2 deletions src/stm/stm32f10x_it.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand Down

0 comments on commit 664c11b

Please sign in to comment.