Suport for altera scaler boot coefficients.

This commit is contained in:
sorgelig
2018-11-10 00:29:16 +08:00
parent 8a75dac4c2
commit 99a0a0b190
3 changed files with 6 additions and 4 deletions

View File

@@ -79,4 +79,6 @@ const char *getFullPath(const char *name);
uint32_t getFileType(const char *name);
#define COEFF_DIR "filters"
#endif

View File

@@ -1334,7 +1334,7 @@ void HandleUI(void)
if (strlen(user_io_get_scaler_coeff())) strncat(s, user_io_get_scaler_coeff(), 22);
else strcat(s, "<none>");
OsdWrite(n++, s, menusub == 5, user_io_get_scaler_flt() != 4 || !S_ISDIR(getFileType("coeff")));
OsdWrite(n++, s, menusub == 5, user_io_get_scaler_flt() != 4 || !S_ISDIR(getFileType(COEFF_DIR)));
OsdWrite(n++);
}
@@ -1423,7 +1423,7 @@ void HandleUI(void)
case 5:
if (user_io_get_scaler_flt() == 4)
{
sprintf(SelectedPath, "coeff/%s", user_io_get_scaler_coeff());
sprintf(SelectedPath, COEFF_DIR"/%s", user_io_get_scaler_coeff());
SelectFile(0, SCANO_COEFF, MENU_COEFF_FILE_SELECTED, MENU_8BIT_SYSTEM1);
}
break;

View File

@@ -2590,16 +2590,16 @@ static void setScaler()
if (!spi_uio_cmd_cont(UIO_SET_FLTNUM))
{
DisableIO();
return;
sprintf(filename, "%s/coeff.txt", HomeDir);
}
else
{
new_scaler = 1;
spi8(scaler_flt_cfg[0]);
DisableIO();
sprintf(filename, COEFF_DIR"/%s", scaler_flt_cfg + 1);
}
sprintf(filename, "coeff/%s", scaler_flt_cfg+1);
if (FileOpen(&f, filename))
{
printf("Read scaler coefficients\n");