forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Keymap] Fix build error
helix:five_rows
(qmk#16847)
- Loading branch information
Showing
7 changed files
with
74 additions
and
283 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2022 Takeshi Ishii (@mtei) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include "pseudo_sprintf.h" | ||
|
||
static char *sprint_decimal(char *buf, int data) { | ||
if (data > 9) { | ||
buf = sprint_decimal(buf, data/10); | ||
} | ||
*buf++ = "0123456789"[data%10]; | ||
*buf = '\0'; | ||
return buf; | ||
} | ||
|
||
static char *sprint_hex(char *buf, uint32_t data) { | ||
if (data > 0xf) { | ||
buf = sprint_hex(buf, data/0x10); | ||
} | ||
*buf++ = "0123456789abcdef"[data & 0xf]; | ||
*buf = '\0'; | ||
return buf; | ||
} | ||
|
||
char *sprints(char *buf, char *src) { | ||
while (*src) { | ||
*buf++ = *src++; | ||
} | ||
*buf = '\0'; | ||
return buf; | ||
} | ||
|
||
char *sprintx(char *buf, char *leadstr, uint32_t data) { | ||
buf = sprints(buf, leadstr); | ||
buf = sprint_hex(buf, data); | ||
return buf; | ||
} | ||
|
||
char *sprintd(char *buf, char *leadstr, int data) { | ||
buf = sprints(buf, leadstr); | ||
buf = sprint_decimal(buf, data); | ||
return buf; | ||
} | ||
|
||
char *sprint2d(char *buf, char *leadstr, int data) { | ||
buf = sprints(buf, leadstr); | ||
if (data > 99) { | ||
return sprint_decimal(buf, data); | ||
} | ||
if (data < 10) { | ||
*buf++ = ' '; | ||
} | ||
return sprint_decimal(buf, data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright 2022 Takeshi Ishii (@mtei) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
char *sprints(char *buf, char *src); | ||
char *sprintd(char *buf, char *leadstr, int data); | ||
char *sprint2d(char *buf, char *leadstr, int data); |