~ruther/qmk_firmware

4b839db3841f001f78291373b2b6c3eca34582ed — yiancar 4 years ago e041ec1
NK65 eeprom compatibility with 128KB and 256KB (#10804)

* NK65 define hack for 128kb 256kb versions of F303

* Updated to chibios define
2 files changed, 13 insertions(+), 2 deletions(-)

M keyboards/nk65/config.h
M keyboards/nk65/nk65.c
M keyboards/nk65/config.h => keyboards/nk65/config.h +11 -0
@@ 144,3 144,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.

// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE

/* Custom EEPROM start addressing. This is to support
 * both 128kb and 256kb versions of F303.
 * Register 0x1FFFF7CC holds the size of the flash memory.
 */
#define EEPROM_START_ADDRESS
#define FEE_MCU_FLASH_SIZE                              \
({                                                      \
    uint16_t (*flash_size) = (uint16_t*)FLASHSIZE_BASE;  \
    *flash_size;                                        \
})

M keyboards/nk65/nk65.c => keyboards/nk65/nk65.c +2 -2
@@ 20,7 20,7 @@
#include "nk65.h"
#include "drivers/issi/is31fl3733.h"

/* Indicator LEDS are part of the LED driver 
/* Indicator LEDS are part of the LED driver
 * Top LED is blue only. LED driver 2 RGB 7 Green channel
 * Middle LED is blue and red. LED driver 2 RGB 6 Red and Blue channel
 * Bottom LED is red only LED driver 2 RGB 6 Green channel.


@@ 48,7 48,7 @@ __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
    if (state & (1UL << 2)) {
        G = 255;
    }
    

    IS31FL3733_set_color( 6+64-1, R, G, B );
  return state;
}