Merge branch 'branch-1.9' into debian
authorBdale Garbee <bdale@gag.com>
Mon, 11 Oct 2021 03:42:53 +0000 (21:42 -0600)
committerBdale Garbee <bdale@gag.com>
Mon, 11 Oct 2021 03:42:53 +0000 (21:42 -0600)
17 files changed:
ChangeLog
altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/AltosDroid.java
altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java
altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/TelemetryLogger.java
altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/TelemetryService.java
altoslib/AltosLog.java
altoslib/AltosLogTrace.java [new file with mode: 0644]
altoslib/Makefile.am
configure.ac
doc/Makefile.am
doc/easymini-release-notes.inc
doc/release-notes-1.9.10.inc [new file with mode: 0644]
doc/release-notes.inc
doc/telegps-release-notes.inc
libaltos/Makefile.am
libaltos/libaltos_windows.c
src/telemega-v5.0/.gitignore [new file with mode: 0644]

index eb720371511734fde09f21f88e9e0cfcfd79c31a..4535447bedcf8ddcd8d915701c798a7689646ad3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,105 @@
+commit ed267e76eb03c34ec233c33a002ec9e5e53ec83a
+Merge: bd71c839 ef70f80b
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Sun Oct 10 21:41:50 2021 -0600
+
+    Merge branch 'master' into branch-1.9
+
+commit ef70f80b324e9c8ba7046b5000e0f28f77a54f8c
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sun Oct 10 09:57:45 2021 -0700
+
+    Version 1.9.10
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 67a1d9b5bcd9bd7dd4156010264cef6b9c87caa3
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sun Oct 10 09:49:49 2021 -0700
+
+    altos/telemega-v5.0: Add .gitignore
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 47d7affffdf97188a034bb48918ec22f03ea5b38
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sun Oct 10 09:47:52 2021 -0700
+
+    doc: Version 1.9.10 notes
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit eb39995ded6b564efcb5a5312119d2672b437bc8
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Oct 9 21:32:17 2021 -0700
+
+    altosdroid: Catch log file open failures and show an error dialog
+    
+    Android changed which directories we can write to once, let's hope it
+    doesn't happen again.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 3488d86de2e114a46e59bd4d2a2d7b95bf633963
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Oct 9 21:31:24 2021 -0700
+
+    altoslib: Add callback from AltosLog on file open failure
+    
+    This lets the UI tell the user that logging isn't working.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 4b3ccb73a26f91917d327558295506ce3c02d684
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Oct 9 20:58:26 2021 -0700
+
+    altosdroid: Switch storage to media dir
+    
+    Even with the WRITE_EXTERNAL_STORAGE permission, we appear to no
+    longer have permission to write to a random external storage
+    dir. Instead, we only have permission to write to an app-specific dir,
+    buried deep in the directory tree. We can get that directory name with
+    getExternalMediaDirs()[0].
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 536e53c2e17b37df8c65d2f6921a5d68791a7789
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Oct 8 18:31:35 2021 -0700
+
+    Version 1.9.9.1
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 5cb393c1743a5c0f307631199abba067821db370
+Author: Keith Packard <keithp@keithp.com>
+Date:   Thu Oct 7 22:45:37 2021 -0700
+
+    libaltos: Use original windows printf/scanf
+    
+    mingw now uses "improved" versions of printf/scanf, which may cause
+    trouble with some windows 10 installs. Just use the old versions.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit c15bb9513ab0f8636bf52ec827551134c773e832
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Oct 6 22:58:09 2021 -0700
+
+    libaltos: Make windows dlls reproducible
+    
+    Use SOURCE_DATE_EPOCH=0 to ensure these dlls are
+    reproducible.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit bd71c839b542c417a90ab59db97e0969f7e27731
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Thu Oct 7 00:00:42 2021 -0600
+
+    releasing 1.9.9
+
 commit 2f1d5b25e72324512238920b45e864bf7c5d16fe
 Merge: c0fe810e 6ef22682
 Author: Bdale Garbee <bdale@gag.com>
index 5caee5f87aab5323ea0032cf54f865649ff22a8b..1fcb0a470a54b6800af756d12cd845835beb5422 100644 (file)
@@ -20,6 +20,7 @@ package org.altusmetrum.AltosDroid;
 
 import java.lang.ref.WeakReference;
 import java.util.*;
+import java.io.*;
 
 import android.Manifest;
 import android.app.Activity;
@@ -86,6 +87,7 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener,
        public static final int MSG_UPDATE_AGE      = 2;
        public static final int MSG_IDLE_MODE       = 3;
        public static final int MSG_IGNITER_STATUS  = 4;
+       public static final int MSG_FILE_FAILED     = 5;
 
        // Intent request codes
        public static final int REQUEST_CONNECT_DEVICE = 1;
@@ -190,6 +192,9 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener,
                                ad.idle_mode = (Boolean) msg.obj;
                                ad.update_state(null);
                                break;
+                       case MSG_FILE_FAILED:
+                               ad.file_failed((File) msg.obj);
+                               break;
                        }
                }
        };
@@ -1010,6 +1015,24 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener,
                }
        }
 
+       boolean fail_shown;
+
+       private void file_failed(File file) {
+               if (!fail_shown) {
+                       fail_shown = true;
+                       AlertDialog fail = new AlertDialog.Builder(this).create();
+                       fail.setTitle("Failed to Create Log File");
+                       fail.setMessage(file.getPath());
+                       fail.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",
+                                      new DialogInterface.OnClickListener() {
+                                              public void onClick(DialogInterface dialog, int which) {
+                                                      dialog.dismiss();
+                                              }
+                                      });
+                       fail.show();
+               }
+       }
+
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
                MenuInflater inflater = getMenuInflater();
index 5d836f5dceeb7f21f9711b0c77beffadfe5fadbc..170353ab4838098035f6e1dc37768bb0ee41f9f4 100644 (file)
@@ -78,15 +78,18 @@ public class AltosDroidPreferencesBackend extends AltosPreferencesBackend {
 
        public String getString(String key, String def) {
                String  ret;
-               ret = prefs.getString(key, def);
-//             AltosDebug.debug("AltosDroidPreferencesBackend get string %s:\n", key);
-//             if (ret == null)
-//                     AltosDebug.debug("      (null)\n");
-//             else {
-//                     String[] lines = ret.split("\n");
-//                     for (String l : lines)
-//                             AltosDebug.debug("        %s\n", l);
-//             }
+               if (key.equals(AltosPreferences.logdirPreference))
+                       ret = null;
+               else
+                       ret = prefs.getString(key, def);
+               AltosDebug.debug("AltosDroidPreferencesBackend get string %s:\n", key);
+               if (ret == null)
+                       AltosDebug.debug("      (null)\n");
+               else {
+                       String[] lines = ret.split("\n");
+                       for (String l : lines)
+                               AltosDebug.debug("        %s\n", l);
+               }
                return ret;
        }
 
@@ -135,7 +138,7 @@ public class AltosDroidPreferencesBackend extends AltosPreferencesBackend {
        }
 
        public File homeDirectory() {
-               return Environment.getExternalStorageDirectory();
+               return context.getExternalMediaDirs()[0];
        }
 
        public void debug(String format, Object ... arguments) {
index 589e15d07a351d96e6f1d0011521f2726191b758..ae5702b48b87dfa9cca64bcaa443057724b6f5f3 100644 (file)
@@ -1,5 +1,24 @@
+/*
+ * Copyright © 2021 Keith Packard <keithp@keithp.com>
+ *
+ * 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, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
 package org.altusmetrum.AltosDroid;
 
+import java.io.*;
+
 import org.altusmetrum.altoslib_14.*;
 
 import android.content.BroadcastReceiver;
@@ -8,15 +27,24 @@ import android.content.Intent;
 import android.content.IntentFilter;
 import android.os.Environment;
 
-public class TelemetryLogger {
-       private Context   context = null;
+public class TelemetryLogger implements AltosLogTrace {
+       private TelemetryService service = null;
        private AltosLink link    = null;
        private AltosLog  logger  = null;
 
        private BroadcastReceiver mExternalStorageReceiver;
 
-       public TelemetryLogger(Context in_context, AltosLink in_link) {
-               context = in_context;
+       /* AltosLogTrace interface */
+       public void trace(String format, Object ... arguments) {
+               AltosDebug.debug(format, arguments);
+       }
+
+       public void open_failed(File file) {
+               service.send_file_failed_to_clients(file);
+       }
+
+       public TelemetryLogger(TelemetryService in_service, AltosLink in_link) {
+               service = in_service;
                link    = in_link;
 
                startWatchingExternalStorage();
@@ -40,7 +68,7 @@ public class TelemetryLogger {
                if (Environment.MEDIA_MOUNTED.equals(state)) {
                        if (logger == null) {
                                AltosDebug.debug("Starting up Telemetry Logging");
-                               logger = new AltosLog(link);
+                               logger = new AltosLog(link,this);
                        }
                } else {
                        AltosDebug.debug("External Storage not present - stopping");
@@ -58,12 +86,12 @@ public class TelemetryLogger {
                IntentFilter filter = new IntentFilter();
                filter.addAction(Intent.ACTION_MEDIA_MOUNTED);
                filter.addAction(Intent.ACTION_MEDIA_REMOVED);
-               context.registerReceiver(mExternalStorageReceiver, filter);
+               service.registerReceiver(mExternalStorageReceiver, filter);
                handleExternalStorageState();
        }
 
        void stopWatchingExternalStorage() {
-               context.unregisterReceiver(mExternalStorageReceiver);
+               service.unregisterReceiver(mExternalStorageReceiver);
        }
 
 }
index 2c2095df68186847225e4480993754123be524a2..b0b82ab9c9673643f8fead134a8a9e9445a8a1d8 100644 (file)
@@ -20,6 +20,7 @@ package org.altusmetrum.AltosDroid;
 
 import java.lang.ref.WeakReference;
 import java.util.concurrent.TimeoutException;
+import java.io.*;
 import java.util.*;
 
 import android.app.*;
@@ -340,6 +341,21 @@ public class TelemetryService extends Service implements AltosIdleMonitorListene
                        send_idle_mode_to_client(client);
        }
 
+       private void send_file_failed_to_client(Messenger client, File f) {
+               Message m = Message.obtain(null, AltosDroid.MSG_FILE_FAILED, f);
+               try {
+                       client.send(m);
+               } catch (RemoteException e) {
+                       AltosDebug.error("Client %s disappeared", client.toString());
+                       remove_client(client);
+               }
+       }
+
+       public void send_file_failed_to_clients(File f) {
+               for (Messenger client : clients)
+                       send_file_failed_to_client(client, f);
+       }
+
        private void telemetry_start() {
                if (telemetry_reader == null && idle_monitor == null && !ignite_running) {
                        telemetry_reader = new TelemetryReader(altos_link, handler);
index 7065614b21c50f52a5f59eca71dc691084282c03..7dc9fd4c4ae2621210ad694ff879f92998448a8d 100644 (file)
@@ -37,6 +37,12 @@ public class AltosLog implements Runnable {
        Thread                          log_thread;
        AltosFile                       file;
        AltosLink                       link;
+       AltosLogTrace                   trace;
+
+       private void trace(String format, Object ... arguments) {
+               if (trace != null)
+                       trace.trace(format, arguments);
+       }
 
        private void close_log_file() {
                if (log_file != null) {
@@ -62,10 +68,25 @@ public class AltosLog implements Runnable {
        }
 
        boolean open (AltosCalData cal_data) throws IOException, InterruptedException {
+               trace("open serial %d flight %d receiver_serial %d",
+                     cal_data.serial,
+                     cal_data.flight,
+                     cal_data.receiver_serial);
+
                AltosFile       a = new AltosFile(cal_data);
 
-               log_file = new FileWriter(a, true);
+               trace("open file %s\n", a.getPath());
+
+               try {
+                       log_file = new FileWriter(a, true);
+               } catch (IOException ie) {
+                       log_file = null;
+                       trace("open file failed\n");
+                       if (trace != null)
+                               trace.open_failed(a);
+               }
                if (log_file != null) {
+                       trace("open file success\n");
                        while (!pending_queue.isEmpty()) {
                                String s = pending_queue.take();
                                log_file.write(s);
@@ -79,6 +100,7 @@ public class AltosLog implements Runnable {
        }
 
        public void run () {
+               trace("log run start\n");
                try {
                        AltosConfigData receiver_config = link.config_data();
                        AltosCalData    cal_data = new AltosCalData();
@@ -117,21 +139,30 @@ public class AltosLog implements Runnable {
                                        pending_queue.put(line.line);
                        }
                } catch (InterruptedException ie) {
+                       trace("interrupted exception\n");
                } catch (TimeoutException te) {
+                       trace("timeout exception\n");
                } catch (IOException ie) {
+                       trace("io exception %s message %s\n", ie.toString(), ie.getMessage());
                }
+               trace("log run done\n");
                close();
        }
 
-       public AltosLog (AltosLink link) {
+       public AltosLog (AltosLink link, AltosLogTrace trace) {
                pending_queue = new LinkedBlockingQueue<String> ();
                input_queue = new LinkedBlockingQueue<AltosLine> ();
                link.add_monitor(input_queue);
                serial = -1;
                flight = -1;
+               this.trace = trace;
                this.link = link;
                log_file = null;
                log_thread = new Thread(this);
                log_thread.start();
        }
+
+       public AltosLog (AltosLink link) {
+               this(link, null);
+       }
 }
diff --git a/altoslib/AltosLogTrace.java b/altoslib/AltosLogTrace.java
new file mode 100644 (file)
index 0000000..64b41d6
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright © 2021 Keith Packard <keithp@keithp.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+package org.altusmetrum.altoslib_14;
+
+import java.io.*;
+import java.net.*;
+
+public interface AltosLogTrace {
+       public abstract void trace(String format, Object ... arguments);
+
+       public abstract void open_failed(File path);
+}
index 39e287fa457f4c2a1473cc64448f5bfd99bce54e..21651ef910ac73b93580396e173ed9d7f2c387d3 100644 (file)
@@ -87,6 +87,7 @@ altoslib_JAVA = \
        AltosLink.java \
        AltosListenerState.java \
        AltosLog.java \
+       AltosLogTrace.java \
        AltosMag.java \
        AltosMma655x.java \
        AltosMs5607.java \
index 71a334b2eb2ed86fc8b70a3def48e8c262c0de65..780db8813df5700c46ea4bf6e2f4eeecf5ce2afc 100644 (file)
@@ -18,13 +18,13 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([altos], 1.9.9)
-ANDROID_VERSION=31
+AC_INIT([altos], 1.9.10)
+ANDROID_VERSION=32
 AC_CONFIG_SRCDIR([src/kernel/ao.h])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
-RELEASE_DATE=2021-10-06
+RELEASE_DATE=2021-10-10
 AC_SUBST(RELEASE_DATE)
 
 DOC_DATE=`LC_ALL=C date -d $RELEASE_DATE +'%d %b %Y'`
index 52c408e367ecec5dde92f1ced747ecf190f6c5e1..d7d92f2cbf76841647ffccda29882b128b4fd77d 100644 (file)
@@ -17,6 +17,7 @@ FAKETIME=TZ=UTC faketime -f '$(RELEASE_DATE) 00:00:00 i0'
 endif
 
 RELNOTES_INC=\
+       release-notes-1.9.10.inc \
        release-notes-1.9.9.inc \
        release-notes-1.9.8.inc \
        release-notes-1.9.7.inc \
index a1b4415a9985ebfa38f7a85c66309c367b1e7dde..34e6471a2e138b5d2e6f97a8e9b934ca09615484 100644 (file)
@@ -1,5 +1,9 @@
 [appendix]
 == Release Notes
+       :leveloffset: 2
+       include::release-notes-1.9.10.adoc[]
+
+       <<<<
        :leveloffset: 2
        include::release-notes-1.9.9.adoc[]
 
diff --git a/doc/release-notes-1.9.10.inc b/doc/release-notes-1.9.10.inc
new file mode 100644 (file)
index 0000000..a3e0786
--- /dev/null
@@ -0,0 +1,21 @@
+= Release Notes for Version 1.9.10
+include::release-head.adoc[]
+:doctype: article
+
+       Version 1.9.9
+
+       This release contains a couple of bug fixes for ground station software.
+
+       == AltosUI
+
+       * Rework the windows DLL build to make AltosUI run on more
+          instances of Windows 10.
+
+       == AltosDroid
+
+       * Adapt to Android security changes which prevent AltosDroid
+         from storing flights in
+         /storage/emulated/0/AltusMetrum. Now, flights are stored in
+         /storage/emulated/0/media/org.altusmetrum.AltosDroid/AltusMetrum
+         instead.  Also, AltosDroid will display an error message if
+         flight data cannot be logged.
index 4a76c96f09e08a4fd7bfa86475b073f24ce4c679..f492981abf3c4f9be7d623c5cb69743c3f40c3a7 100644 (file)
@@ -1,5 +1,9 @@
 [appendix]
 == Release Notes
+       :leveloffset: 2
+       include::release-notes-1.9.10.adoc[]
+
+       <<<<
        :leveloffset: 2
        include::release-notes-1.9.9.adoc[]
 
index 90f2e27e0d5947e57414e77e91e3936bedaddc04..dedc6d4a773b6591bf9924a490a37eeb19c90168 100644 (file)
@@ -1,5 +1,9 @@
 [appendix]
 == Release Notes
+       :leveloffset: 2
+       include::release-notes-1.9.10.adoc[]
+
+       <<<<
        :leveloffset: 2
        include::release-notes-1.9.9.adoc[]
 
index 2b9a7aa6b85614a05b542eb8f644b68b1fb06c21..98fa8c11aea7d2e5b60cba1405103f71c6b5cc5a 100644 (file)
@@ -122,10 +122,10 @@ MINGLIBS=-lsetupapi -lws2_32
 fat: all altos.dll altos64.dll
 
 altos.dll: $(WINDOWS_SRC) $(WINDOWS_H)
-       $(MINGCC32) -o $@ $(MINGFLAGS) -shared $(WINDOWS_SRC) $(MINGLIBS)
+       SOURCE_DATE_EPOCH=0 $(MINGCC32) -o $@ $(MINGFLAGS) -shared $(WINDOWS_SRC) $(MINGLIBS)
 
 altos64.dll: $(WINDOWS_SRC) $(WINDOWS_H)
-       $(MINGCC64) -o $@ $(MINGFLAGS) -shared $(WINDOWS_SRC) $(MINGLIBS)
+       SOURCE_DATE_EPOCH=0 $(MINGCC64) -o $@ $(MINGFLAGS) -shared $(WINDOWS_SRC) $(MINGLIBS)
 
 clean-local:
        -rm -rf libaltosJNI *.class *.java classlibaltos.stamp $(SWIG_FILE) libaltos_wrap.c altos.dll altos64.dll
index 33eb77c7ac7c1149f4e03823e8218ca49e399989..f91859ac51e7e3859863965ccaa4b48958f7f5e4 100644 (file)
@@ -59,12 +59,12 @@ log_message(char *fmt, ...)
                char    buffer[4096];
 
                GetLocalTime(&time);
-               sprintf (buffer, "%4d-%02d-%02d %2d:%02d:%02d. ",
+               __ms_sprintf (buffer, "%4d-%02d-%02d %2d:%02d:%02d. ",
                         time.wYear, time.wMonth, time.wDay,
                         time.wHour, time.wMinute, time.wSecond);
                va_start(a, fmt);
 
-               vsprintf(buffer + strlen(buffer), fmt, a);
+               __ms_vsprintf(buffer + strlen(buffer), fmt, a);
                va_end(a);
 
                fputs(buffer, log);
@@ -188,11 +188,11 @@ altos_list_next(struct altos_list *list, struct altos_device *device)
                        if (result != 0) {
                                altos_set_last_windows_error();
                        } else {
-                               sscanf((char *) symbolic + sizeof("\\??\\USB#VID_") - 1,
+                               __ms_sscanf((char *) symbolic + sizeof("\\??\\USB#VID_") - 1,
                                       "%04X", &vid);
-                               sscanf((char *) symbolic + sizeof("\\??\\USB#VID_XXXX&PID_") - 1,
+                               __ms_sscanf((char *) symbolic + sizeof("\\??\\USB#VID_XXXX&PID_") - 1,
                                       "%04X", &pid);
-                               sscanf((char *) symbolic + sizeof("\\??\\USB#VID_XXXX&PID_XXXX#") - 1,
+                               __ms_sscanf((char *) symbolic + sizeof("\\??\\USB#VID_XXXX&PID_XXXX#") - 1,
                                       "%d", &serial);
                        }
                        if (vid == 0 || pid == 0 || serial == 0) {
@@ -201,11 +201,11 @@ altos_list_next(struct altos_list *list, struct altos_device *device)
                                                               instanceid,
                                                               sizeof (instanceid),
                                                               &instanceid_len)) {
-                                       sscanf((char *) instanceid + sizeof("USB\\VID_") - 1,
+                                       __ms_sscanf((char *) instanceid + sizeof("USB\\VID_") - 1,
                                               "%04X", &vid);
-                                       sscanf((char *) instanceid + sizeof("USB\\VID_XXXX&PID_") - 1,
+                                       __ms_sscanf((char *) instanceid + sizeof("USB\\VID_XXXX&PID_") - 1,
                                               "%04X", &pid);
-                                       sscanf((char *) instanceid + sizeof("USB\\VID_XXXX&PID_XXXX\\") - 1,
+                                       __ms_sscanf((char *) instanceid + sizeof("USB\\VID_XXXX&PID_XXXX\\") - 1,
                                               "%d", &serial);
                                } else {
                                        altos_set_last_windows_error();
@@ -667,7 +667,7 @@ static void
 ba2str(BTH_ADDR ba, char *str)
 {
 
-       sprintf(str, "%02X:%02X:%02X:%02X:%02X:%02X",
+       __ms_sprintf(str, "%02X:%02X:%02X:%02X:%02X:%02X",
                get_byte(ba, 0),
                get_byte(ba, 1),
                get_byte(ba, 2),
@@ -681,7 +681,7 @@ str2ba(char *str)
 {
        unsigned int    bytes[6];
 
-       sscanf(str,  "%02x:%02x:%02x:%02x:%02x:%02x",
+       __ms_sscanf(str,  "%02x:%02x:%02x:%02x:%02x:%02x",
               &bytes[0],
               &bytes[1],
               &bytes[2],
diff --git a/src/telemega-v5.0/.gitignore b/src/telemega-v5.0/.gitignore
new file mode 100644 (file)
index 0000000..e67759a
--- /dev/null
@@ -0,0 +1,2 @@
+ao_product.h
+telemega-*.elf