Skip to content

Instantly share code, notes, and snippets.

@pdp7
Created June 7, 2019 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdp7/b898803d32894d83f5ab156d4295d621 to your computer and use it in GitHub Desktop.
Save pdp7/b898803d32894d83f5ab156d4295d621 to your computer and use it in GitHub Desktop.
diff
pdp7@sp3:~/dev/macchina/watchdog$ git diff src/
diff --git a/src/exti.h b/src/exti.h
index 0715fba..c93d290 100644
--- a/src/exti.h
+++ b/src/exti.h
@@ -9,6 +9,7 @@
#include <libopencm3/cm3/scb.h>
#include "hal.h"
diff --git a/src/exti.h b/src/exti.h
index 0715fba..c93d290 100644
--- a/src/exti.h
+++ b/src/exti.h
@@ -9,6 +9,7 @@
#include <libopencm3/cm3/scb.h>
#include "hal.h"
+#include "comms.h"
#define check_interrupt(pin) ((EXTI_PR & pin & wakeup_mask) != 0)
#define WRITE_BUF_LEN 8
@@ -22,4 +23,4 @@ extern volatile bool should_power_off;
extern volatile bool should_use_internal_power;
extern volatile bool should_use_car_power;
-#endif
\ No newline at end of file
+#endif
diff --git a/src/hal.c b/src/hal.c
index b0f749f..408034a 100644
--- a/src/hal.c
+++ b/src/hal.c
@@ -145,6 +145,7 @@ void i2c_setup(void)
i2c_peripheral_enable(I2C1);
// i2c_enable_ack(I2C1);
+ I2C1_OAR1 |= I2C_OAR1_OA1EN_ENABLE;
}
void adc_setup(void)
@pdp7
Copy link
Author

pdp7 commented Jun 7, 2019

pdp7@sp3:~/dev/macchina/watchdog$ lsusb |grep ST
Bus 001 Device 018: ID 0483:374b STMicroelectronics ST-LINK/V2.1 (Nucleo-F103RB)

[204707.221391] usb 1-1.2: new full-speed USB device number 18 using xhci_hcd
[204707.334869] usb 1-1.2: New USB device found, idVendor=0483, idProduct=374b
[204707.334873] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[204707.334876] usb 1-1.2: Product: STM32 STLink
[204707.334878] usb 1-1.2: Manufacturer: STMicroelectronics
[204707.334880] usb 1-1.2: SerialNumber: 066EFF515455777867204816
[204707.390321] usb-storage 1-1.2:1.1: USB Mass Storage device detected
[204707.390685] scsi host3: usb-storage 1-1.2:1.1
[204707.391196] cdc_acm 1-1.2:1.2: ttyACM0: USB ACM device
[204708.418290] scsi 3:0:0:0: Direct-Access     MBED     microcontroller  1.0  PQ: 0 ANSI: 2
[204708.419168] sd 3:0:0:0: Attached scsi generic sg1 type 0
[204708.419227] sd 3:0:0:0: [sdb] 104 512-byte logical blocks: (53.2 kB/52.0 KiB)
[204708.419435] sd 3:0:0:0: [sdb] Write Protect is off
[204708.419438] sd 3:0:0:0: [sdb] Mode Sense: 03 00 00 00
[204708.419664] sd 3:0:0:0: [sdb] No Caching mode page found
[204708.419669] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[204708.437696] sd 3:0:0:0: [sdb] Attached SCSI removable disk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment