Skip to content

Commit

Permalink
reorganising files
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Feb 6, 2024
1 parent 585aa5b commit 0bf0918
Show file tree
Hide file tree
Showing 27 changed files with 39 additions and 31 deletions.
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ MAIN_SOURCES := $(SRCDIR)/main.c \
$(LAYOUT_SOURCES)
MAIN_OBJECTS := $(MAIN_SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.rel)

LIB_SOURCES := $(wildcard $(SRCDIR)/lib/*.c)
LIB_OBJECTS := $(LIB_SOURCES:$(SRCDIR)/lib/%.c=$(OBJDIR)/lib/%.rel)
LIBSINO8051_SOURCES := $(wildcard $(SRCDIR)/lib/sh68f90a/*.c)
LIBSINO8051_OBJECTS := $(LIBSINO8051_SOURCES:$(SRCDIR)/lib/sh68f90a/%.c=$(OBJDIR)/lib/sh68f90a/%.rel)

OVERRIDABLE_SOURCES := $(wildcard $(SRCDIR)/overridable/*.c)
OVERRIDABLE_OBJECTS := $(OVERRIDABLE_SOURCES:$(SRCDIR)/overridable/%.c=$(OBJDIR)/overridable/%.rel)

.PHONY: all clean flash

Expand All @@ -64,13 +67,17 @@ $(OBJDIR)/%.rel: $(SRCDIR)/%.c
@mkdir -p $(@D)
$(CC) -m$(FAMILY) -l$(PROC) $(CFLAGS) -c $< -o $@

$(BINDIR)/smk.lib: $(LIB_OBJECTS)
$(BINDIR)/overridable.lib: $(OVERRIDABLE_OBJECTS)
@mkdir -p $(@D)
$(SDAR) $@ $^

$(BINDIR)/sino8051.lib: $(LIBSINO8051_OBJECTS)
@mkdir -p $(@D)
$(SDAR) $@ $^

$(BINDIR)/main.ihx: $(MAIN_OBJECTS) $(BINDIR)/smk.lib
$(BINDIR)/main.ihx: $(MAIN_OBJECTS) $(BINDIR)/sino8051.lib $(BINDIR)/overridable.lib
@mkdir -p $(@D)
$(CC) -m$(FAMILY) -l$(PROC) $(LFLAGS) -o $@ $(MAIN_OBJECTS) -L$(BINDIR) -lsmk
$(CC) -m$(FAMILY) -l$(PROC) $(LFLAGS) -o $@ $(MAIN_OBJECTS) -L$(BINDIR) -loverridable -lsino8051

$(BINDIR)/%.hex: $(BINDIR)/%.ihx
${PACKIHX} < $< > $@
Expand Down
2 changes: 1 addition & 1 deletion src/host.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "host.h"
#include "debug.h"
#include "usb.h"
#include "lib/sh68f90a/usb.h"

/* send report */
void host_keyboard_send(report_keyboard_t *report)
Expand Down
4 changes: 2 additions & 2 deletions src/keyboards/nuphy-air60/layouts/default/indicators.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "../../../../indicators.h"
#include "../../../../sh68f90a.h"
#include "../../../../pwm.h"
#include "../../../../lib/sh68f90a/sh68f90a.h"
#include "../../../../lib/sh68f90a/pwm.h"
#include <stdlib.h>

bool indicators_update_step(keyboard_state_t *keyboard, uint8_t current_step)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/delay.c → src/lib/sh68f90a/delay.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "delay.h"
#include "watchdog.h"
#include "utils.h"
#include "../../utils.h"
#include <stdint.h>

// very naive implementation, not very accurate or optimized
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/keyboard.c → src/lib/sh68f90a/keyboard.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "keyboard.h"
#include "../../keyboard.h"
#include "sh68f90a.h"
#include "debug.h"
#include "../../debug.h"

__xdata keyboard_state_t keyboard_state;

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pwm.c → src/lib/sh68f90a/pwm.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "pwm.h"
#include "matrix.h"
#include "../../matrix.h"
#include <stdint.h>
#include <stdio.h>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/usb.c → src/lib/sh68f90a/usb.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "usb.h"
#include "watchdog.h"
#include "isp.h"
#include "usbdef.h"
#include "../../usbdef.h"
#include "usbregs.h"
#include "debug.h"
#include "utils.h"
#include "usbhidreport.h"
#include "keyboard.h"
#include "../../debug.h"
#include "../../utils.h"
#include "../../usbhidreport.h"
#include "../../keyboard.h"
#include <stdint.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion src/usb.h → src/lib/sh68f90a/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define USB_H

#include "sh68f90a.h"
#include "report.h"
#include "../../report.h"
#include <stdint.h>

void usb_init();
Expand Down
File renamed without changes.
File renamed without changes.
21 changes: 11 additions & 10 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#include "clock.h"
#include "ldo.h"
#include "watchdog.h"
#include "delay.h"
#include "isp.h"
#include "uart.h"
#include "stdio.h"
#include "gpio.h"
#include "lib/sh68f90a/clock.h"
#include "lib/sh68f90a/ldo.h"
#include "lib/sh68f90a/watchdog.h"
#include "lib/sh68f90a/delay.h"
#include "lib/sh68f90a/isp.h"
#include "lib/sh68f90a/uart.h"
#include "lib/sh68f90a/gpio.h"
#include "matrix.h"
#include "pwm.h"
#include "usb.h"
#include "lib/sh68f90a/pwm.h"
#include "lib/sh68f90a/usb.h"
#include "debug.h"
#include "utils.h"
#include "keyboard.h"

#include <stdio.h>

void init()
{
ldo_init();
Expand Down
6 changes: 3 additions & 3 deletions src/matrix.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "matrix.h"
#include "sh68f90a.h"
#include "pwm.h"
#include "delay.h"
#include "lib/sh68f90a/sh68f90a.h"
#include "lib/sh68f90a/pwm.h"
#include "lib/sh68f90a/delay.h"
#include "layout.h"
#include "report.h"
#include "debug.h"
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 0bf0918

Please sign in to comment.