Merge pull request #725 from keyboardio/arduino-ide-avr-hotfix

Improved ATmega class naming
pull/729/head
Jesse Vincent 5 years ago committed by GitHub
commit f524955253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
/* -*- mode: c++ -*- /* -*- mode: c++ -*-
* device::ATMega32U4Keyboard -- Generic ATMega32U4 keyboard base class * device::ATmega32U4Keyboard -- Generic ATmega32U4 keyboard base class
* Copyright (C) 2019 Keyboard.io, Inc * Copyright (C) 2019 Keyboard.io, Inc
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -22,31 +22,32 @@
#include <Arduino.h> #include <Arduino.h>
#include "kaleidoscope/device/Base.h" #include "kaleidoscope/device/Base.h"
#include "kaleidoscope/driver/mcu/ATMega32U4.h" #include "kaleidoscope/driver/mcu/ATmega32U4.h"
#include "kaleidoscope/driver/storage/ATMega32U4EEPROMProps.h" #include "kaleidoscope/driver/keyscanner/ATmega.h"
#include "kaleidoscope/driver/storage/ATmega32U4EEPROMProps.h"
#include "kaleidoscope/driver/storage/AVREEPROM.h" #include "kaleidoscope/driver/storage/AVREEPROM.h"
#define ATMEGA32U4_KEYBOARD(BOARD_, BOOTLOADER_, ROW_PINS_, COL_PINS_) \ #define ATMEGA32U4_KEYBOARD(BOARD_, BOOTLOADER_, ROW_PINS_, COL_PINS_) \
struct BOARD_##Props : kaleidoscope::device::ATMega32U4KeyboardProps { \ struct BOARD_##Props : kaleidoscope::device::ATmega32U4KeyboardProps { \
struct KeyScannerProps : public kaleidoscope::driver::keyscanner::AVRProps { \ struct KeyScannerProps : public kaleidoscope::driver::keyscanner::ATmegaProps { \
AVR_KEYSCANNER_PROPS(ROW_PIN_LIST(ROW_PINS_), COL_PIN_LIST(COL_PINS_)); \ ATMEGA_KEYSCANNER_PROPS(ROW_PIN_LIST(ROW_PINS_), COL_PIN_LIST(COL_PINS_)); \
}; \ }; \
typedef kaleidoscope::driver::keyscanner::AVR<KeyScannerProps> KeyScanner; \ typedef kaleidoscope::driver::keyscanner::ATmega<KeyScannerProps> KeyScanner; \
typedef kaleidoscope::driver::bootloader::avr::BOOTLOADER_ BootLoader; \ typedef kaleidoscope::driver::bootloader::avr::BOOTLOADER_ BootLoader; \
}; \ }; \
class BOARD_: public kaleidoscope::device::ATMega32U4Keyboard<BOARD_##Props> {}; class BOARD_: public kaleidoscope::device::ATmega32U4Keyboard<BOARD_##Props> {};
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {
struct ATMega32U4KeyboardProps : kaleidoscope::device::BaseProps { struct ATmega32U4KeyboardProps : kaleidoscope::device::BaseProps {
typedef kaleidoscope::driver::mcu::ATMega32U4 MCU; typedef kaleidoscope::driver::mcu::ATmega32U4 MCU;
typedef kaleidoscope::driver::storage::ATMega32U4EEPROMProps StorageProps; typedef kaleidoscope::driver::storage::ATmega32U4EEPROMProps StorageProps;
typedef kaleidoscope::driver::storage::AVREEPROM<StorageProps> Storage; typedef kaleidoscope::driver::storage::AVREEPROM<StorageProps> Storage;
}; };
template <typename _DeviceProps> template <typename _DeviceProps>
class ATMega32U4Keyboard : public kaleidoscope::device::Base<_DeviceProps> { class ATmega32U4Keyboard : public kaleidoscope::device::Base<_DeviceProps> {
public: public:
auto serialPort() -> decltype(Serial) & { auto serialPort() -> decltype(Serial) & {
return Serial; return Serial;

@ -41,20 +41,20 @@ struct cRGB {
#include "kaleidoscope/driver/keyscanner/Base.h" #include "kaleidoscope/driver/keyscanner/Base.h"
#include "kaleidoscope/driver/bootloader/avr/HalfKay.h" #include "kaleidoscope/driver/bootloader/avr/HalfKay.h"
#include "kaleidoscope/device/ATMega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {
namespace ez { namespace ez {
struct ErgoDoxProps : public kaleidoscope::device::ATMega32U4KeyboardProps { struct ErgoDoxProps : public kaleidoscope::device::ATmega32U4KeyboardProps {
struct KeyScannerProps : kaleidoscope::driver::keyscanner::BaseProps { struct KeyScannerProps : kaleidoscope::driver::keyscanner::BaseProps {
KEYSCANNER_PROPS(14, 6); KEYSCANNER_PROPS(14, 6);
}; };
typedef kaleidoscope::driver::bootloader::avr::HalfKay Bootloader; typedef kaleidoscope::driver::bootloader::avr::HalfKay Bootloader;
}; };
class ErgoDox : public kaleidoscope::device::ATMega32U4Keyboard<ErgoDoxProps> { class ErgoDox : public kaleidoscope::device::ATmega32U4Keyboard<ErgoDoxProps> {
public: public:
ErgoDox(void) {} ErgoDox(void) {}

@ -23,7 +23,7 @@ namespace kaleidoscope {
namespace device { namespace device {
namespace kbdfans { namespace kbdfans {
AVR_KEYSCANNER_BOILERPLATE ATMEGA_KEYSCANNER_BOILERPLATE
} }
} }

@ -23,26 +23,26 @@
#include <Arduino.h> #include <Arduino.h>
#include "kaleidoscope/driver/keyscanner/AVR.h" #include "kaleidoscope/driver/keyscanner/ATmega.h"
#include "kaleidoscope/driver/bootloader/avr/FLIP.h" #include "kaleidoscope/driver/bootloader/avr/FLIP.h"
#include "kaleidoscope/device/ATMega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {
namespace kbdfans { namespace kbdfans {
struct KBD4xProps : kaleidoscope::device::ATMega32U4KeyboardProps { struct KBD4xProps : kaleidoscope::device::ATmega32U4KeyboardProps {
struct KeyScannerProps : public kaleidoscope::driver::keyscanner::AVRProps { struct KeyScannerProps : public kaleidoscope::driver::keyscanner::ATmegaProps {
AVR_KEYSCANNER_PROPS( ATMEGA_KEYSCANNER_PROPS(
ROW_PIN_LIST({ PIN_D0, PIN_D1, PIN_D2, PIN_D3 }), ROW_PIN_LIST({ PIN_D0, PIN_D1, PIN_D2, PIN_D3 }),
COL_PIN_LIST({ PIN_F0, PIN_F1, PIN_F4, PIN_F5, PIN_F6, PIN_F7, PIN_B3, PIN_B1, PIN_B0, PIN_D5, PIN_B7, PIN_C7 }) COL_PIN_LIST({ PIN_F0, PIN_F1, PIN_F4, PIN_F5, PIN_F6, PIN_F7, PIN_B3, PIN_B1, PIN_B0, PIN_D5, PIN_B7, PIN_C7 })
); );
}; };
typedef kaleidoscope::driver::keyscanner::AVR<KeyScannerProps> KeyScanner; typedef kaleidoscope::driver::keyscanner::ATmega<KeyScannerProps> KeyScanner;
typedef kaleidoscope::driver::bootloader::avr::FLIP Bootloader; typedef kaleidoscope::driver::bootloader::avr::FLIP Bootloader;
}; };
class KBD4x: public kaleidoscope::device::ATMega32U4Keyboard<KBD4xProps> { class KBD4x: public kaleidoscope::device::ATmega32U4Keyboard<KBD4xProps> {
public: public:
KBD4x() { KBD4x() {
mcu_.disableJTAG(); mcu_.disableJTAG();

@ -48,7 +48,7 @@ static constexpr uint8_t LED_REGISTER_DATA1_SIZE = 0xAB;
static constexpr uint8_t LED_REGISTER_DATA_LARGEST = LED_REGISTER_DATA0_SIZE; static constexpr uint8_t LED_REGISTER_DATA_LARGEST = LED_REGISTER_DATA0_SIZE;
AVR_KEYSCANNER_BOILERPLATE ATMEGA_KEYSCANNER_BOILERPLATE
bool ImagoLEDDriver::isLEDChanged = true; bool ImagoLEDDriver::isLEDChanged = true;
cRGB ImagoLEDDriver::led_data[]; cRGB ImagoLEDDriver::led_data[];
@ -181,7 +181,7 @@ void Imago::setup() {
} }
TWBR = 10; TWBR = 10;
kaleidoscope::device::ATMega32U4Keyboard<ImagoProps>::setup(); kaleidoscope::device::ATmega32U4Keyboard<ImagoProps>::setup();
} }
} }

@ -29,10 +29,10 @@ struct cRGB {
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r,g,b) (cRGB){b, g, r}
#include "kaleidoscope/driver/keyscanner/AVR.h" #include "kaleidoscope/driver/keyscanner/ATmega.h"
#include "kaleidoscope/driver/led/Base.h" #include "kaleidoscope/driver/led/Base.h"
#include "kaleidoscope/driver/bootloader/avr/Caterina.h" #include "kaleidoscope/driver/bootloader/avr/Caterina.h"
#include "kaleidoscope/device/ATMega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {
@ -61,20 +61,20 @@ class ImagoLEDDriver : public kaleidoscope::driver::led::Base<ImagoLEDDriverProp
static void twiSend(uint8_t addr, uint8_t Reg_Add, uint8_t Reg_Dat); static void twiSend(uint8_t addr, uint8_t Reg_Add, uint8_t Reg_Dat);
}; };
struct ImagoProps : kaleidoscope::device::ATMega32U4KeyboardProps { struct ImagoProps : kaleidoscope::device::ATmega32U4KeyboardProps {
struct KeyScannerProps : public kaleidoscope::driver::keyscanner::AVRProps { struct KeyScannerProps : public kaleidoscope::driver::keyscanner::ATmegaProps {
AVR_KEYSCANNER_PROPS( ATMEGA_KEYSCANNER_PROPS(
ROW_PIN_LIST({ PIN_F6, PIN_F5, PIN_F4, PIN_F1, PIN_F0}), ROW_PIN_LIST({ PIN_F6, PIN_F5, PIN_F4, PIN_F1, PIN_F0}),
COL_PIN_LIST({ PIN_B2, PIN_B7, PIN_E2, PIN_C7, PIN_C6, PIN_B6, PIN_B5, PIN_B4, PIN_D7, PIN_D6, PIN_D4, PIN_D5, PIN_D3, PIN_D2, PIN_E6, PIN_F7}) COL_PIN_LIST({ PIN_B2, PIN_B7, PIN_E2, PIN_C7, PIN_C6, PIN_B6, PIN_B5, PIN_B4, PIN_D7, PIN_D6, PIN_D4, PIN_D5, PIN_D3, PIN_D2, PIN_E6, PIN_F7})
); );
}; };
typedef kaleidoscope::driver::keyscanner::AVR<KeyScannerProps> KeyScanner; typedef kaleidoscope::driver::keyscanner::ATmega<KeyScannerProps> KeyScanner;
typedef ImagoLEDDriverProps LEDDriverProps; typedef ImagoLEDDriverProps LEDDriverProps;
typedef ImagoLEDDriver LEDDriver; typedef ImagoLEDDriver LEDDriver;
typedef kaleidoscope::driver::bootloader::avr::Caterina BootLoader; typedef kaleidoscope::driver::bootloader::avr::Caterina BootLoader;
}; };
class Imago: public kaleidoscope::device::ATMega32U4Keyboard<ImagoProps> { class Imago: public kaleidoscope::device::ATmega32U4Keyboard<ImagoProps> {
public: public:
void setup(); void setup();
}; };

@ -29,7 +29,7 @@
#include "kaleidoscope/driver/keyscanner/Base.h" #include "kaleidoscope/driver/keyscanner/Base.h"
#include "kaleidoscope/driver/led/Base.h" #include "kaleidoscope/driver/led/Base.h"
#include "kaleidoscope/driver/bootloader/avr/Caterina.h" #include "kaleidoscope/driver/bootloader/avr/Caterina.h"
#include "kaleidoscope/device/ATMega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {
@ -93,7 +93,7 @@ class Model01KeyScanner : public kaleidoscope::driver::keyscanner::Base<Model01K
static void enableScannerPower(); static void enableScannerPower();
}; };
struct Model01Props : kaleidoscope::device::ATMega32U4KeyboardProps { struct Model01Props : kaleidoscope::device::ATmega32U4KeyboardProps {
typedef Model01LEDDriverProps LEDDriverProps; typedef Model01LEDDriverProps LEDDriverProps;
typedef Model01LEDDriver LEDDriver; typedef Model01LEDDriver LEDDriver;
typedef Model01KeyScannerProps KeyScannerProps; typedef Model01KeyScannerProps KeyScannerProps;
@ -101,7 +101,7 @@ struct Model01Props : kaleidoscope::device::ATMega32U4KeyboardProps {
typedef kaleidoscope::driver::bootloader::avr::Caterina BootLoader; typedef kaleidoscope::driver::bootloader::avr::Caterina BootLoader;
}; };
class Model01 : public kaleidoscope::device::ATMega32U4Keyboard<Model01Props> { class Model01 : public kaleidoscope::device::ATmega32U4Keyboard<Model01Props> {
public: public:
static void setup(); static void setup();

@ -23,7 +23,7 @@ namespace kaleidoscope {
namespace device { namespace device {
namespace olkb { namespace olkb {
AVR_KEYSCANNER_BOILERPLATE ATMEGA_KEYSCANNER_BOILERPLATE
} }
} }

@ -21,9 +21,8 @@
#include <Arduino.h> #include <Arduino.h>
#include "kaleidoscope/driver/keyscanner/AVR.h"
#include "kaleidoscope/driver/bootloader/avr/HalfKay.h" #include "kaleidoscope/driver/bootloader/avr/HalfKay.h"
#include "kaleidoscope/device/ATMega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {

@ -30,7 +30,7 @@ namespace kaleidoscope {
namespace device { namespace device {
namespace softhruf { namespace softhruf {
AVR_KEYSCANNER_BOILERPLATE ATMEGA_KEYSCANNER_BOILERPLATE
} }
} }

@ -30,26 +30,26 @@
#include <Arduino.h> #include <Arduino.h>
#include "kaleidoscope/driver/keyscanner/AVR.h" #include "kaleidoscope/driver/keyscanner/ATmega.h"
#include "kaleidoscope/driver/bootloader/avr/FLIP.h" #include "kaleidoscope/driver/bootloader/avr/FLIP.h"
#include "kaleidoscope/device/ATMega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {
namespace softhruf { namespace softhruf {
struct SplitographyProps : kaleidoscope::device::ATMega32U4KeyboardProps { struct SplitographyProps : kaleidoscope::device::ATmega32U4KeyboardProps {
struct KeyScannerProps : public kaleidoscope::driver::keyscanner::AVRProps { struct KeyScannerProps : public kaleidoscope::driver::keyscanner::ATmegaProps {
AVR_KEYSCANNER_PROPS( ATMEGA_KEYSCANNER_PROPS(
ROW_PIN_LIST({ PIN_D0, PIN_D1, PIN_D2, PIN_D3 }), ROW_PIN_LIST({ PIN_D0, PIN_D1, PIN_D2, PIN_D3 }),
COL_PIN_LIST({ PIN_F0, PIN_F1, PIN_F4, PIN_F5, PIN_F6, PIN_F7, PIN_C7, PIN_C6, PIN_B6, PIN_B5, PIN_B4, PIN_D7 }) COL_PIN_LIST({ PIN_F0, PIN_F1, PIN_F4, PIN_F5, PIN_F6, PIN_F7, PIN_C7, PIN_C6, PIN_B6, PIN_B5, PIN_B4, PIN_D7 })
); );
}; };
typedef kaleidoscope::driver::keyscanner::AVR<KeyScannerProps> KeyScanner; typedef kaleidoscope::driver::keyscanner::ATmega<KeyScannerProps> KeyScanner;
typedef kaleidoscope::driver::bootloader::avr::FLIP BootLoader; typedef kaleidoscope::driver::bootloader::avr::FLIP BootLoader;
}; };
class Splitography: public kaleidoscope::device::ATMega32U4Keyboard<SplitographyProps> { class Splitography: public kaleidoscope::device::ATmega32U4Keyboard<SplitographyProps> {
public: public:
Splitography() { Splitography() {
mcu_.disableJTAG(); mcu_.disableJTAG();

@ -32,7 +32,7 @@ namespace kaleidoscope {
namespace device { namespace device {
namespace technomancy { namespace technomancy {
AVR_KEYSCANNER_BOILERPLATE ATMEGA_KEYSCANNER_BOILERPLATE
} }
} }

@ -28,9 +28,8 @@
#include <Arduino.h> #include <Arduino.h>
#include "kaleidoscope/driver/keyscanner/AVR.h"
#include "kaleidoscope/driver/bootloader/avr/HalfKay.h" #include "kaleidoscope/driver/bootloader/avr/HalfKay.h"
#include "kaleidoscope/device/ATMega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {

@ -24,7 +24,7 @@ namespace kaleidoscope {
namespace device { namespace device {
namespace technomancy { namespace technomancy {
AVR_KEYSCANNER_BOILERPLATE ATMEGA_KEYSCANNER_BOILERPLATE
} }
} }

@ -22,9 +22,8 @@
#include <Arduino.h> #include <Arduino.h>
#include "kaleidoscope/driver/keyscanner/AVR.h"
#include "kaleidoscope/driver/bootloader/avr/Caterina.h" #include "kaleidoscope/driver/bootloader/avr/Caterina.h"
#include "kaleidoscope/device/ATMega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace device { namespace device {

@ -1,5 +1,5 @@
/* -*- mode: c++ -*- /* -*- mode: c++ -*-
* kaleidoscope::driver::keyscanner::AVR -- AVR-based keyscanner component * kaleidoscope::driver::keyscanner::ATmega -- AVR ATmega-based keyscanner component
* Copyright (C) 2018-2019 Keyboard.io, Inc * Copyright (C) 2018-2019 Keyboard.io, Inc
* *
* This program is free software: you can redistribute it and/or modify it under * This program is free software: you can redistribute it and/or modify it under
@ -29,20 +29,20 @@
#define ROW_PIN_LIST(...) __VA_ARGS__ #define ROW_PIN_LIST(...) __VA_ARGS__
#define COL_PIN_LIST(...) __VA_ARGS__ #define COL_PIN_LIST(...) __VA_ARGS__
#define AVR_KEYSCANNER_PROPS(ROW_PINS_, COL_PINS_) \ #define ATMEGA_KEYSCANNER_PROPS(ROW_PINS_, COL_PINS_) \
KEYSCANNER_PROPS(NUM_ARGS(ROW_PINS_), NUM_ARGS(COL_PINS_)); \ KEYSCANNER_PROPS(NUM_ARGS(ROW_PINS_), NUM_ARGS(COL_PINS_)); \
static constexpr uint8_t matrix_row_pins[matrix_rows] = ROW_PINS_; \ static constexpr uint8_t matrix_row_pins[matrix_rows] = ROW_PINS_; \
static constexpr uint8_t matrix_col_pins[matrix_columns] = COL_PINS_; static constexpr uint8_t matrix_col_pins[matrix_columns] = COL_PINS_;
#define AVR_KEYSCANNER_BOILERPLATE \ #define ATMEGA_KEYSCANNER_BOILERPLATE \
KEYSCANNER_PROPS_BOILERPLATE(kaleidoscope::Device::KeyScannerProps); \ KEYSCANNER_PROPS_BOILERPLATE(kaleidoscope::Device::KeyScannerProps); \
constexpr uint8_t kaleidoscope::Device::KeyScannerProps::matrix_row_pins[matrix_rows]; \ constexpr uint8_t kaleidoscope::Device::KeyScannerProps::matrix_row_pins[matrix_rows]; \
constexpr uint8_t kaleidoscope::Device::KeyScannerProps::matrix_col_pins[matrix_columns]; \ constexpr uint8_t kaleidoscope::Device::KeyScannerProps::matrix_col_pins[matrix_columns]; \
template<> \ template<> \
volatile uint16_t kaleidoscope::Device::KeyScanner::previousKeyState_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \ volatile uint16_t kaleidoscope::Device::KeyScanner::previousKeyState_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
template<> \ template<> \
volatile uint16_t kaleidoscope::Device::KeyScanner::keyState_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \ volatile uint16_t kaleidoscope::Device::KeyScanner::keyState_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
template<> \ template<> \
uint16_t kaleidoscope::Device::KeyScanner::masks_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \ uint16_t kaleidoscope::Device::KeyScanner::masks_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
template<> \ template<> \
uint8_t kaleidoscope::Device::KeyScanner::debounce_matrix_[kaleidoscope::Device::KeyScannerProps::matrix_rows][kaleidoscope::Device::KeyScannerProps::matrix_columns] = {}; \ uint8_t kaleidoscope::Device::KeyScanner::debounce_matrix_[kaleidoscope::Device::KeyScannerProps::matrix_rows][kaleidoscope::Device::KeyScannerProps::matrix_columns] = {}; \
@ -55,7 +55,7 @@ namespace kaleidoscope {
namespace driver { namespace driver {
namespace keyscanner { namespace keyscanner {
struct AVRProps: kaleidoscope::driver::keyscanner::BaseProps { struct ATmegaProps: kaleidoscope::driver::keyscanner::BaseProps {
static const uint8_t debounce = 3; static const uint8_t debounce = 3;
/* /*
@ -67,9 +67,9 @@ struct AVRProps: kaleidoscope::driver::keyscanner::BaseProps {
}; };
template <typename _KeyScannerProps> template <typename _KeyScannerProps>
class AVR : public kaleidoscope::driver::keyscanner::Base<_KeyScannerProps> { class ATmega: public kaleidoscope::driver::keyscanner::Base<_KeyScannerProps> {
private: private:
typedef AVR<_KeyScannerProps> ThisType; typedef ATmega<_KeyScannerProps> ThisType;
public: public:
void setup() { void setup() {

@ -1,5 +1,5 @@
/* -*- mode: c++ -*- /* -*- mode: c++ -*-
* driver::MCU::ATMega32U4 -- ATMega32U4 MCU driver for Kaleidoscope * driver::MCU::ATmega32U4 -- ATmega32U4 MCU driver for Kaleidoscope
* Copyright (C) 2019 Keyboard.io, Inc * Copyright (C) 2019 Keyboard.io, Inc
* *
* This program is free software: you can redistribute it and/or modify it under * This program is free software: you can redistribute it and/or modify it under
@ -23,7 +23,7 @@ namespace kaleidoscope {
namespace driver { namespace driver {
namespace mcu { namespace mcu {
class ATMega32U4 : public kaleidoscope::driver::mcu::Base { class ATmega32U4 : public kaleidoscope::driver::mcu::Base {
public: public:
void detachFromHost() { void detachFromHost() {
UDCON |= _BV(DETACH); UDCON |= _BV(DETACH);
@ -45,7 +45,7 @@ class ATMega32U4 : public kaleidoscope::driver::mcu::Base {
* that's doable, we just have to write the JTD bit into MCUCR twice within * that's doable, we just have to write the JTD bit into MCUCR twice within
* four cycles. These two lines do just that. * four cycles. These two lines do just that.
* *
* For more information, see the ATMega16U4/ATMega32U4 datasheet, the * For more information, see the ATmega16U4/ATmega32U4 datasheet, the
* following sections: * following sections:
* - 2.2.7 (PIN Descriptions; PIN F) * - 2.2.7 (PIN Descriptions; PIN F)
* - 7.8.7 (On-chip Debug System) * - 7.8.7 (On-chip Debug System)

@ -1,5 +1,5 @@
/* -*- mode: c++ -*- /* -*- mode: c++ -*-
* kaleidoscope::driver::storage::ATMega32U4StorageProps -- Storage driver props for ATMega32U4 * kaleidoscope::driver::storage::ATmega32U4StorageProps -- Storage driver props for ATmega32U4
* Copyright (C) 2019 Keyboard.io, Inc * Copyright (C) 2019 Keyboard.io, Inc
* *
* This program is free software: you can redistribute it and/or modify it under * This program is free software: you can redistribute it and/or modify it under
@ -23,7 +23,7 @@ namespace kaleidoscope {
namespace driver { namespace driver {
namespace storage { namespace storage {
struct ATMega32U4EEPROMProps : kaleidoscope::driver::storage::AVREEPROMProps { struct ATmega32U4EEPROMProps : kaleidoscope::driver::storage::AVREEPROMProps {
static constexpr uint16_t length = 1024; static constexpr uint16_t length = 1024;
}; };
Loading…
Cancel
Save