Skip to content

Commit

Permalink
code quality improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lingex committed Mar 13, 2021
1 parent b48d4c9 commit 4cac4bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Inc/matrix_led.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ typedef struct

bool MatrixTaskPush(uint8_t x, uint8_t y, uint8_t keyVal);

void MatrixTaskTimer(uint32_t timeTick);
void MatrixTaskTimer();

void SpiTransmit(uint8_t* pData, uint16_t len);

Expand Down
6 changes: 3 additions & 3 deletions Src/matrix_led.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,12 @@ bool MatrixTaskPush(uint8_t x, uint8_t y, uint8_t keyVal)
return false;
}

void MatrixTaskTimer(uint32_t timeTick)
void MatrixTaskTimer()
{
static uint8_t taskIndex;
static uint8_t taskIndex = 0;
MatrixTaskTypeDef* pTask = &matrixTask[taskIndex];

if (pTask->keyVal > 0 && timeTick >= pTask->keyVal)
if (pTask->keyVal > 0)
{
MatrixOnKeyPressed(pTask->x, pTask->y, pTask->keyVal);
pTask->keyVal = 0; //free this task
Expand Down

0 comments on commit 4cac4bd

Please sign in to comment.