Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update: use actual versions

  • Loading branch information...
commit 820b53168c1586668f553e35c640cbee8759da83 1 parent a400522
Sébastien Bourdeauducq sbourdeauducq authored
2  src/Makefile
View
@@ -13,7 +13,7 @@ OBJDIR=obj
BINDIR=bin
# base
-OBJS=shellext.o sysconfig.o config.o fb.o input.o keymap.o fbgrab.o shortcuts.o osc.o pngload.o flashvalid.o main.o
+OBJS=version.o shellext.o sysconfig.o config.o fb.o input.o keymap.o fbgrab.o shortcuts.o osc.o pngload.o flashvalid.o main.o
# GUI
OBJS+=messagebox.o filedialog.o resmgr.o guirender.o performance.o cp.o keyboard.o ir.o audio.o midi.o oscsettings.o dmxspy.o dmxdesk.o dmx.o videoin.o rsswall.o patcheditor.o monitor.o firstpatch.o filemanager.o sysettings.o about.o flash.o shutdown.o
32 src/about.c
View
@@ -17,10 +17,6 @@
#include <bsp.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
#include <mtklib.h>
#include "version.h"
@@ -39,40 +35,14 @@ static void flash_callback(mtk_event *e, void *arg)
open_flash_window();
}
-static void read_dev(const char *dev, char *buf, unsigned int len)
-{
- int fd;
- int rl;
-
- buf[0] = '?';
- buf[1] = 0;
- fd = open(dev, O_RDONLY);
- if(fd == -1) return;
- rl = read(fd, buf, len-1);
- if(rl <= 0) {
- close(fd);
- return;
- }
- buf[rl] = 0;
- close(fd);
-
-}
-
#define FLASH_OFFSET_MAC_ADDRESS (0x002200E0)
void init_about()
{
- char soc[13];
- char pcb[3];
- char pcb_rev[2];
unsigned char *macadr = (unsigned char *)FLASH_OFFSET_MAC_ADDRESS;
appid = mtk_init_app("About");
- read_dev("/dev/soc", soc, sizeof(soc));
- read_dev("/dev/pcb", pcb, sizeof(pcb));
- read_dev("/dev/pcb_rev", pcb_rev, sizeof(pcb_rev));
-
mtk_cmd_seq(appid,
"g = new Grid()",
@@ -105,7 +75,7 @@ void init_about()
"g_btn = new Grid()",
- "b_flash = new Button(-text \"Flash\")",
+ "b_flash = new Button(-text \"Update\")",
"b_close = new Button(-text \"Close\")",
"g_btn.place(b_flash, -column 1 -row 1)",
14 src/flash.c
View
@@ -36,6 +36,7 @@
#include "messagebox.h"
#include "input.h"
#include "flashvalid.h"
+#include "version.h"
#include "flash.h"
@@ -508,7 +509,7 @@ void init_flash()
mtk_cmd_seq(appid,
"g = new Grid()",
- "l0 = new Label(-text \"Click the 'Update from web' button to begin.\nIf your synthesizer does not restart after the upgrade, don't panic!\nHold right (R) pushbutton during power-up to enable rescue mode.\")",
+ "l0 = new Label(-text \"Click the 'Update from web' button to begin.\nIf your synthesizer does not restart after the update, don't panic!\nHold right (R) pushbutton during power-up to enable rescue mode.\")",
"g.place(l0, -column 1 -row 1 -align w)",
@@ -517,9 +518,12 @@ void init_flash()
"l_flickernoise = new Label(-text \"Flickernoise:\")",
"l_installed = new Label(-text \"Installed\")",
"l_available = new Label(-text \"Available\")",
- "l_socbios_i = new Label(-text \"1.0RC4\")",
+ 0);
+
+ mtk_cmdf(appid, "l_socbios_i = new Label(-text \"%s\")", soc);
+ mtk_cmd_seq(appid,
"l_socbios_a = new Label(-text \"?\")",
- "l_flickernoise_i = new Label(-text \"1.0RC1\")",
+ "l_flickernoise_i = new Label(-text \""VERSION"\")",
"l_flickernoise_a = new Label(-text \"?\")",
"g2.place(l_socbios, -column 1 -row 2)",
"g2.place(l_flickernoise, -column 1 -row 3)",
@@ -560,7 +564,7 @@ void init_flash()
"g.rowconfig(2, -size 0)",
"g.rowconfig(3, -size 0)",
- "w = new Window(-content g -title \"Upgrade\")",
+ "w = new Window(-content g -title \"Update\")",
"gfiles = new Grid()",
@@ -606,7 +610,7 @@ void init_flash()
"gfiles.place(gfiles_btn, -column 1 -row 2)",
- "w_files = new Window(-content gfiles -title \"Upgrade from files\")",
+ "w_files = new Window(-content gfiles -title \"Update from files\")",
0);
mtk_bind(appid, "b_webupdate", "commit", run_callback, (void *)ARG_WEB_UPDATE);
5 src/main.c
View
@@ -46,6 +46,7 @@
#include <yaffs.h>
#include <curl/curl.h>
+#include "version.h"
#include "shellext.h"
#include "sysconfig.h"
#include "fb.h"
@@ -116,7 +117,7 @@ static rtems_task gui_task(rtems_task_argument argument)
if(sysconfig_is_rescue())
messagebox("Rescue mode", "You have booted in rescue mode.\n"
"Your system will function as usual, using back-up software.\n"
- "From there, you can upgrade the main software or perform\nother actions to fix the problem.\n");
+ "From there, you can update the main software or perform\nother actions to fix the problem.\n");
/* FIXME: work around "black screen" bug in MTK */
mtk_cmd(1, "screen.refresh()");
@@ -168,6 +169,8 @@ rtems_task Init(rtems_task_argument argument)
start_memcard();
mkdir("/ssd", 0777);
mount("/dev/flash5", "/ssd", "yaffs", RTEMS_FILESYSTEM_READ_WRITE, "");
+
+ init_version();
sysconfig_load();
rtems_bsdnet_initialize_network();
50 src/version.c
View
@@ -0,0 +1,50 @@
+/*
+ * Flickernoise
+ * Copyright (C) 2010, 2011 Sebastien Bourdeauducq
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+char soc[13];
+char pcb[3];
+char pcb_rev[2];
+
+static void read_dev(const char *dev, char *buf, unsigned int len)
+{
+ int fd;
+ int rl;
+
+ buf[0] = '?';
+ buf[1] = 0;
+ fd = open(dev, O_RDONLY);
+ if(fd == -1) return;
+ rl = read(fd, buf, len-1);
+ if(rl <= 0) {
+ close(fd);
+ return;
+ }
+ buf[rl] = 0;
+ close(fd);
+}
+
+void init_version()
+{
+ read_dev("/dev/soc", soc, sizeof(soc));
+ read_dev("/dev/pcb", pcb, sizeof(pcb));
+ read_dev("/dev/pcb_rev", pcb_rev, sizeof(pcb_rev));
+}
6 src/version.h
View
@@ -20,4 +20,10 @@
#define VERSION "1.0RC1"
+extern char soc[];
+extern char pcb[];
+extern char pcb_rev[];
+
+void init_version();
+
#endif /* __VERSION_H */
Please sign in to comment.
Something went wrong with that request. Please try again.