Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alx-Lai committed Aug 17, 2024
1 parent 5084edd commit 7667b78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fw/Core/Hitcon/App/ShowNameApp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ namespace {

// Update once every 15s. Units: ms.
constexpr unsigned kMinUpdateInterval = 15 * 1000;
static const char SURPRISE_NAME[] = "Cool!";
static const char SURPRISE_NAME[] = "You got pwned!";
static const int SURPRISE_NAME_LEN = sizeof(SURPRISE_NAME) / sizeof(char);
static constexpr unsigned SURPRISE_TIME = 10000;
static constexpr unsigned SURPRISE_TIME = 10 * 1000;

} // namespace
ShowNameApp show_name_app;
Expand Down
4 changes: 2 additions & 2 deletions fw/Core/Hitcon/Logic/BadgeController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ void BadgeController::OnButton(void *arg1) {
if (button == COMBO_BUTTON[combo_button_ctr]) {
combo_button_ctr++;
} else {
combo_button_ctr = 0;
combo_button_ctr = (button == COMBO_BUTTON[0]) ? 1 : 0;
}
if (combo_button_ctr == COMBO_BUTTON_LEN) {
// surprise
combo_button_ctr = 0;
combo_button_ctr = (button == COMBO_BUTTON[0]) ? 1 : 0;
if (this->callback) this->callback(callback_arg1, callback_arg2);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions fw/Core/Hitcon/Util/uint_to_str.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

unsigned int hitcon::uint_to_chr(char *str, unsigned size, int n) {
int count = 0;
while ((n != 0) && (count < size - 1)) {
do {
str[count++] = '0' + (n % 10);
n /= 10;
}
} while ((n != 0) && (count < size - 1));
str[count] = 0;
// reverse string
char *p1 = str;
Expand Down

0 comments on commit 7667b78

Please sign in to comment.