diff options
| author | Adam Lee <[email protected]> | 2017-05-07 14:36:10 -0700 | 
|---|---|---|
| committer | Adam Lee <[email protected]> | 2017-05-07 14:36:10 -0700 | 
| commit | f2fcab96a8dd8cc70d6785da76621c48df1af94c (patch) | |
| tree | 9be0967ab0d3795e6d20299988c84280f3ad98f6 /quantum/process_keycode/process_printer.c | |
| parent | f90321bdcbcbd196ee642cdd8cc31aa0f6ac121e (diff) | |
| parent | 2704c163da590d3020f6d87717c400611de81110 (diff) | |
| download | qmk_firmware-f2fcab96a8dd8cc70d6785da76621c48df1af94c.tar.gz qmk_firmware-f2fcab96a8dd8cc70d6785da76621c48df1af94c.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/process_keycode/process_printer.c')
| -rw-r--r-- | quantum/process_keycode/process_printer.c | 22 | 
1 files changed, 11 insertions, 11 deletions
| diff --git a/quantum/process_keycode/process_printer.c b/quantum/process_keycode/process_printer.c index 807f7a0b91..613af70183 100644 --- a/quantum/process_keycode/process_printer.c +++ b/quantum/process_keycode/process_printer.c @@ -20,12 +20,12 @@  bool printing_enabled = false;  uint8_t character_shift = 0; -void enabled_printing() { +void enable_printing(void) {  	printing_enabled = true;  	serial_init();  } -void disable_printing() { +void disable_printing(void) {  	printing_enabled = false;  } @@ -41,9 +41,14 @@ void print_char(char c) {  	USB_Init();  } -void print_box_string(uint8_t text[]) { -	uint8_t len = strlen(text); -	uint8_t out[len * 3 + 8]; +void print_string(char c[]) { +	for(uint8_t i = 0; i < strlen(c); i++) +		print_char(c[i]); +} + +void print_box_string(const char text[]) { +	size_t len = strlen(text); +	char out[len * 3 + 8];  	out[0] = 0xDA;  	for (uint8_t i = 0; i < len; i++) {  		out[i+1] = 0xC4; @@ -69,14 +74,9 @@ void print_box_string(uint8_t text[]) {  	print_string(out);   } -void print_string(char c[]) { -	for(uint8_t i = 0; i < strlen(c); i++) -		print_char(c[i]); -} -  bool process_printer(uint16_t keycode, keyrecord_t *record) {  	if (keycode == PRINT_ON) { -		enabled_printing(); +		enable_printing();  		return false;  	}  	if (keycode == PRINT_OFF) { | 
