chore(cleanup): made sure everything is up to the subject expectations
This commit is contained in:
parent
6df43256c6
commit
62bc2be46e
3 changed files with 16 additions and 11 deletions
|
|
@ -78,16 +78,20 @@ void wheel(uint8_t pos) {
|
|||
}
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
// OC2B = PD3 → output
|
||||
void init_rgb(void)
|
||||
{
|
||||
DDRD |= RGB_MASK;
|
||||
|
||||
t0_init_fpwm_3(PRESCALER_64);
|
||||
t2_init_fpwm_3(PRESCALER_64);
|
||||
|
||||
t0_set_out_mode(TO_A | TO_B, TOM_00);
|
||||
t2_set_out_mode(TO_B, TOM_00);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
// OC2B = PD3 → output
|
||||
|
||||
init_rgb();
|
||||
uint8_t pos = 0;
|
||||
while (1) {
|
||||
wheel(pos++);
|
||||
|
|
|
|||
|
|
@ -84,17 +84,20 @@ const char* HEX_DIGIT = "0123456789ABCDEF";
|
|||
|
||||
#define BUFFERSIZE (1 + 6 + 1)
|
||||
|
||||
int main(void) {
|
||||
// OC2B = PD3 → output
|
||||
DDRD |= RGB_MASK;
|
||||
|
||||
uart_init();
|
||||
|
||||
void init_rgb(void)
|
||||
{
|
||||
t0_init_fpwm_3(PRESCALER_64);
|
||||
t2_init_fpwm_3(PRESCALER_64);
|
||||
|
||||
t0_set_out_mode(TO_A | TO_B, TOM_00);
|
||||
t2_set_out_mode(TO_B, TOM_00);
|
||||
DDRD |= RGB_MASK;
|
||||
}
|
||||
|
||||
|
||||
int main(void) {
|
||||
uart_init();
|
||||
init_rgb();
|
||||
|
||||
char buffer[BUFFERSIZE];
|
||||
uint8_t cursor = 0;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ void uart_send_u16(uint16_t val) {
|
|||
uart_sendstring(buf);
|
||||
}
|
||||
|
||||
*/
|
||||
void uart_send_u8_hex(uint8_t val) {
|
||||
char buf[3] = {0, 0, 0};
|
||||
buf[0] = "0123456789abcdef"[(val >> 4) & 0x0F];
|
||||
|
|
@ -93,7 +92,6 @@ void uart_send_u8_hex(uint8_t val) {
|
|||
|
||||
uart_sendstring(buf);
|
||||
}
|
||||
/*
|
||||
|
||||
void uart_send_u16_hex(uint16_t val) {
|
||||
char buf[5] = {0, 0, 0, 0, 0};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue