commit:ff54f9880addb3e4bf6025bc9510df3fc0401bf8
author:Chip
committer:Chip
date:Sun Aug 27 23:39:55 2023 -0500
parents:be0e9113b39cb7e1a9ad702392031c79f9911eca
Fix composite device
diff --git a/Cargo.toml b/Cargo.toml
line changes: +1/-1
index fbb4c1e..8c2ac3f
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ codegen-units = 1
 debug = 2
 debug-assertions = true
 incremental = false
-#opt-level = 3
+opt-level = 3
 overflow-checks = true
 
 # cargo build/run --release

diff --git a/memory.x b/memory.x
line changes: +7/-7
index e6eaa2f..68f96ec
--- a/memory.x
+++ b/memory.x
@@ -17,6 +17,13 @@ SECTIONS {
 } INSERT BEFORE .text;
 
 SECTIONS {
+    .kheap (NOLOAD) : ALIGN(4) {
+        *(.kheap);
+        . = ALIGN(4);
+    } > SRAM4
+} INSERT AFTER .bss;
+
+SECTIONS {
     .kgram1 : {
         *(.kgram1);
         . = ALIGN(4);
@@ -32,11 +39,4 @@ SECTIONS {
     __skgram2 = ADDR(.kgram2);
     __ekgram2 = ADDR(.kgram2) + SIZEOF(.kgram2);
     __lkgram2 = LOADADDR(.kgram1);
-} INSERT AFTER .bss;
-
-SECTIONS {
-    .kheap (NOLOAD) : ALIGN(4) {
-        *(.kheap);
-        . = ALIGN(4);
-    } > RAM
 } INSERT AFTER .bss; 
\ No newline at end of file

diff --git a/src/main.rs b/src/main.rs
line changes: +8/-10
index 1d28f0a..051a0b1
--- a/src/main.rs
+++ b/src/main.rs
@@ -10,7 +10,6 @@ mod timer;
 use allocator::init_allocator;
 use bsp::entry;
 use console::init_console;
-use cortex_m_rt::pre_init;
 use doa_hallonbrod as bsp;
 use embedded_hal::digital::v2::OutputPin;
 use peripherals::{init_peripherals, with_peripherals, with_usb};
@@ -18,19 +17,18 @@ use r0;
 use usbd_human_interface_device::page::Keyboard;
 use usbd_human_interface_device::UsbHidError;
 
-#[pre_init]
-unsafe fn pre_init() {
-    extern "C" {
-        static mut __skgram1: u32;
-        static mut __ekgram1: u32;
-        static mut __lkgram1: u32;
-    }
-
-    r0::init_data(&mut __skgram1, &mut __ekgram1, &mut __lkgram1);
+extern "C" {
+    static mut __skgram1: u32;
+    static mut __ekgram1: u32;
+    static mut __lkgram1: u32;
 }
 
 #[entry]
 fn main() -> ! {
+    unsafe {
+        r0::init_data(&mut __skgram1, &mut __ekgram1, &mut __lkgram1);
+    }
+
     init_allocator();
     init_peripherals();
     init_console();

diff --git a/src/peripherals/usbdev.rs b/src/peripherals/usbdev.rs
line changes: +1/-0
index 64c5a00..d8d7bcd
--- a/src/peripherals/usbdev.rs
+++ b/src/peripherals/usbdev.rs
@@ -82,6 +82,7 @@ pub fn init_usb(
         .manufacturer("The Dominion of Awesome")
         .product("Smorgasboard")
         .serial_number("LOLBUTTS")
+        .composite_with_iads()
         .build();
 
     critical_section::with(|cs| {