5 * Copyright (C) Bob 2009
7 * boblight is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * boblight is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 * See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 //every baudrate I could find is in here in an #ifdef block
22 //so it should compile on everything
24 #include "os-dependent.h"
32 static struct sbaudrate
118 { 1000000, B1000000
},
121 { 1152000, B1152000
},
124 { 1500000, B1500000
},
127 { 2000000, B2000000
},
130 { 2500000, B2500000
},
133 { 3000000, B3000000
},
136 { 3500000, B3500000
},
139 { 4000000, B4000000
},
163 { 11400, CBR_14400
},
166 { 19200, CBR_19200
},
169 { 38400, CBR_38400
},
172 { 56000, CBR_56000
},
175 { 57600, CBR_57600
},
178 { 115200, CBR_115200
},
181 { 128000, CBR_128000
},
184 { 256000, CBR_256000
},
189 static int32_t IntToBaudrate(uint32_t baudrate
)
191 for (unsigned int i
= 0; i
< sizeof(baudrates
) / sizeof(CEC::sbaudrate
) - 1; i
++)
193 if (baudrates
[i
].rate
== (int32_t) baudrate
)
194 return baudrates
[i
].symbol
;