Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge sg2002&&sg2000 to 1 file #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/platform/milkv/duo256m.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

struct platform_t *milkv_duo256m = NULL;

extern int duo256m_pin_pwm[20][2];
extern int *sg200x_pin_pwm;

static int map[] = {
/* XGPIOA[28] XGPIOA[29] XGPIOA[19] XGPIOA[18] */
28, 29, 19, 18,
Expand Down Expand Up @@ -42,13 +45,14 @@ static int milkv_duo256mValidGPIO(int pin) {
}

static int milkv_duo256mSetup(void) {
sg200x_pin_pwm = &duo256m_pin_pwm;
return milkvSetup(milkv_duo256m, map, _sizeof(map));
}

void milkv_duo256mInit(void) {
platform_register(&milkv_duo256m, "milkv_duo256m");

milkv_duo256m->soc = soc_get("Sophgo", "SG2002");
milkv_duo256m->soc = soc_get("Sophgo", "SG200X");
milkv_duo256m->soc->setMap(map, _sizeof(map));

milkvInit(milkv_duo256m);
Expand Down
6 changes: 5 additions & 1 deletion src/platform/milkv/duos.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

struct platform_t *milkv_duos = NULL;

extern int duos_pin_pwm[20][2];
extern int *sg200x_pin_pwm;

static int map[] = {
/* XGPIOA[29] 3V3 VSYS XGPIOB[20] */
29, -1, -1, 52,
Expand Down Expand Up @@ -60,13 +63,14 @@ static int milkv_duosValidGPIO(int pin) {
}

static int milkv_duosSetup(void) {
sg200x_pin_pwm = &duos_pin_pwm;
return milkvSetup(milkv_duos, map, _sizeof(map));
}

void milkv_duosInit(void) {
platform_register(&milkv_duos, "milkv_duos");

milkv_duos->soc = soc_get("Sophgo", "SG2000");
milkv_duos->soc = soc_get("Sophgo", "SG200X");
milkv_duos->soc->setMap(map, _sizeof(map));

milkvInit(milkv_duos);
Expand Down
665 changes: 0 additions & 665 deletions src/soc/sophgo/sg2002.c

This file was deleted.

22 changes: 0 additions & 22 deletions src/soc/sophgo/sg2002.h

This file was deleted.

Loading