|
1 | 1 | /*
|
2 | 2 | * The MIT License (MIT)
|
3 | 3 | *
|
4 |
| - * Copyright (c) 2018, hathach for Adafruit |
| 4 | + * Copyright (c) 2019, hathach for Adafruit |
5 | 5 | *
|
6 | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | 7 | * of this software and associated documentation files (the "Software"), to deal
|
@@ -54,6 +54,10 @@ static void usb_device_task(void* param)
|
54 | 54 | }
|
55 | 55 | }
|
56 | 56 |
|
| 57 | +//--------------------------------------------------------------------+ |
| 58 | +// Core Init & Touch1200 |
| 59 | +//--------------------------------------------------------------------+ |
| 60 | + |
57 | 61 | // Init usb hardware when starting up. Softdevice is not enabled yet
|
58 | 62 | static void usb_hardware_init(void)
|
59 | 63 | {
|
@@ -99,7 +103,20 @@ void Adafruit_TinyUSB_Core_touch1200(void)
|
99 | 103 | enterSerialDfu();
|
100 | 104 | }
|
101 | 105 |
|
102 |
| -uint8_t load_serial_number(uint16_t* serial_str) |
| 106 | +//--------------------------------------------------------------------+ |
| 107 | +// Adafruit_USBD_Device platform dependent |
| 108 | +//--------------------------------------------------------------------+ |
| 109 | +void Adafruit_USBD_Device::detach(void) |
| 110 | +{ |
| 111 | + NRF_USBD->USBPULLUP = 0; |
| 112 | +} |
| 113 | + |
| 114 | +void Adafruit_USBD_Device::attach(void) |
| 115 | +{ |
| 116 | + NRF_USBD->USBPULLUP = 1; |
| 117 | +} |
| 118 | + |
| 119 | +uint8_t Adafruit_USBD_Device::getSerialDescriptor(uint16_t* serial_str) |
103 | 120 | {
|
104 | 121 | // Serial is 64-bit DeviceID -> 16 chars len
|
105 | 122 | char tmp_serial[17];
|
|
0 commit comments