File tree Expand file tree Collapse file tree 4 files changed +31
-14
lines changed Expand file tree Collapse file tree 4 files changed +31
-14
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ vpath %.s $(SRC_DIR)
48
48
49
49
STARTUP =startup_stm32f10x_hd.s
50
50
USB_SRCS =hw_config.c stm32_it.c usb_prop.c usb_desc.c usb_istr.c usb_pwr.c \
51
- usb_endp.c
51
+ usb_endp.c usb.c
52
52
53
53
54
54
SRCS =main.c system_stm32f10x.c syscalls.c fsmc_nand.c chip_db.c led.c uart.c \
Original file line number Diff line number Diff line change 10
10
/* SPL */
11
11
#include <stm32f10x.h>
12
12
/* USB */
13
- #include <usb_lib.h>
14
- #include <usb_pwr.h>
15
- #include "hw_config.h"
13
+ #include "usb.h"
16
14
#include "cdc.h"
17
15
/* LED */
18
16
#include "led.h"
@@ -190,15 +188,6 @@ static np_comm_cb_t *np_comm_cb;
190
188
191
189
uint8_t np_packet_send_buf [NP_PACKET_BUF_SIZE ];
192
190
193
- static void np_usb_init ()
194
- {
195
- Set_System ();
196
- Set_USBClock ();
197
- USB_Interrupts_Config ();
198
- USB_Init ();
199
- while (!USB_IsDeviceConfigured ());
200
- }
201
-
202
191
static int np_send_ok_status ()
203
192
{
204
193
np_resp_t status = { NP_RESP_STATUS , NP_STATUS_OK };
@@ -813,7 +802,7 @@ int main()
813
802
printf ("done.\r\n" );
814
803
815
804
printf ("USB init..." );
816
- np_usb_init ();
805
+ usb_init ();
817
806
printf ("done.\r\n" );
818
807
819
808
printf ("CDC init..." );
Original file line number Diff line number Diff line change
1
+ /* Copyright (C) 2017 Bogdan Bogush <[email protected] >
2
+ * This program is free software; you can redistribute it and/or modify
3
+ * it under the terms of the GNU General Public License version 3.
4
+ */
5
+
6
+ #include "hw_config.h"
7
+ #include <usb_lib.h>
8
+ #include <usb_pwr.h>
9
+
10
+ void usb_init ()
11
+ {
12
+ Set_System ();
13
+ Set_USBClock ();
14
+ USB_Interrupts_Config ();
15
+ USB_Init ();
16
+ while (!USB_IsDeviceConfigured ());
17
+ }
Original file line number Diff line number Diff line change
1
+ /* Copyright (C) 2017 Bogdan Bogush <[email protected] >
2
+ * This program is free software; you can redistribute it and/or modify
3
+ * it under the terms of the GNU General Public License version 3.
4
+ */
5
+
6
+ #ifndef _USB_H_
7
+ #define _USB_H_
8
+
9
+ void usb_init ();
10
+
11
+ #endif
You can’t perform that action at this time.
0 commit comments