Changeset a35b458 in mainline for kernel/genarch/src/srln/srln.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/srln/srln.c
r3061bc1 ra35b458 53 53 bool cr = false; 54 54 uint32_t escape = 0; 55 55 56 56 while (true) { 57 57 wchar_t ch = indev_pop_character(&instance->raw); 58 58 59 59 /* ANSI escape sequence processing */ 60 60 if (escape != 0) { 61 61 escape <<= 8; 62 62 escape |= ch & 0xff; 63 63 64 64 if ((escape == 0x1b4f) || (escape == 0x1b5b) || (escape == 0x1b5b33)) 65 65 continue; 66 66 67 67 switch (escape) { 68 68 case 0x1b4f46: … … 100 100 } 101 101 } 102 102 103 103 if (ch == 0x1b) { 104 104 escape = ch & 0xff; 105 105 continue; 106 106 } 107 107 108 108 /* Replace carriage return with line feed 109 109 and suppress any following line feed */ … … 112 112 continue; 113 113 } 114 114 115 115 if (ch == '\r') { 116 116 ch = '\n'; … … 118 118 } else 119 119 cr = false; 120 120 121 121 /* Backspace */ 122 122 if (ch == 0x7f) 123 123 ch = '\b'; 124 124 125 125 indev_push_character(instance->sink, ch); 126 126 } … … 134 134 instance->thread = thread_create(ksrln, (void *) instance, 135 135 TASK, THREAD_FLAG_NONE, "ksrln"); 136 136 137 137 if (!instance->thread) { 138 138 free(instance); 139 139 return NULL; 140 140 } 141 141 142 142 instance->sink = NULL; 143 143 indev_initialize("srln", &instance->raw, &srln_raw_ops); 144 144 } 145 145 146 146 return instance; 147 147 } … … 151 151 assert(instance); 152 152 assert(sink); 153 153 154 154 instance->sink = sink; 155 155 thread_ready(instance->thread); 156 156 157 157 return &instance->raw; 158 158 }
Note:
See TracChangeset
for help on using the changeset viewer.