Commit f3104f3a authored by Jacob Vosmaer's avatar Jacob Vosmaer

Change defines to enums

parent 6a355548
......@@ -42,10 +42,6 @@ uint8_t spi_io(uint8_t data) {
}
#define DAC_SYNC PORTB1
#define MOSI PORTB3
#define MISO PORTB4
#define SCK PORTB5
#define SS PORTB2
uint8_t dac_command_set(uint8_t v) {
struct dac *d = dac(v);
......@@ -65,6 +61,8 @@ void dac_send(uint8_t command, uint16_t data) {
}
void spi_init(void) {
enum { MOSI = PORTB3, MISO = PORTB4, SCK = PORTB5, SS = PORTB2 };
// slave select, sck, mosi all as output
DDRB |= _BV(SS) | _BV(MOSI) | _BV(SCK);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment