Skip to content

Commit 415d622

Browse files
graduateDesigngraduateDesign
authored andcommitted
Merge remote-tracking branch 'origin/dev'
2 parents 2592e67 + 9a3b45c commit 415d622

File tree

17 files changed

+1169
-900
lines changed

17 files changed

+1169
-900
lines changed

demo/stm32g030c8/Core/Src/main.c

Lines changed: 234 additions & 198 deletions
Large diffs are not rendered by default.
Lines changed: 141 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,141 @@
1-
/* USER CODE BEGIN Header */
2-
/**
3-
******************************************************************************
4-
* @file stm32g0xx_it.c
5-
* @brief Interrupt Service Routines.
6-
******************************************************************************
7-
* @attention
8-
*
9-
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
10-
* All rights reserved.</center></h2>
11-
*
12-
* This software component is licensed by ST under BSD 3-Clause license,
13-
* the "License"; You may not use this file except in compliance with the
14-
* License. You may obtain a copy of the License at:
15-
* opensource.org/licenses/BSD-3-Clause
16-
*
17-
******************************************************************************
18-
*/
19-
/* USER CODE END Header */
20-
21-
/* Includes ------------------------------------------------------------------*/
22-
#include "main.h"
23-
#include "stm32g0xx_it.h"
24-
/* Private includes ----------------------------------------------------------*/
25-
/* USER CODE BEGIN Includes */
26-
/* USER CODE END Includes */
27-
28-
/* Private typedef -----------------------------------------------------------*/
29-
/* USER CODE BEGIN TD */
30-
31-
/* USER CODE END TD */
32-
33-
/* Private define ------------------------------------------------------------*/
34-
/* USER CODE BEGIN PD */
35-
36-
/* USER CODE END PD */
37-
38-
/* Private macro -------------------------------------------------------------*/
39-
/* USER CODE BEGIN PM */
40-
41-
/* USER CODE END PM */
42-
43-
/* Private variables ---------------------------------------------------------*/
44-
/* USER CODE BEGIN PV */
45-
46-
/* USER CODE END PV */
47-
48-
/* Private function prototypes -----------------------------------------------*/
49-
/* USER CODE BEGIN PFP */
50-
51-
/* USER CODE END PFP */
52-
53-
/* Private user code ---------------------------------------------------------*/
54-
/* USER CODE BEGIN 0 */
55-
56-
/* USER CODE END 0 */
57-
58-
/* External variables --------------------------------------------------------*/
59-
60-
/* USER CODE BEGIN EV */
61-
62-
/* USER CODE END EV */
63-
64-
/******************************************************************************/
65-
/* Cortex-M0+ Processor Interruption and Exception Handlers */
66-
/******************************************************************************/
67-
/**
68-
* @brief This function handles Non maskable interrupt.
69-
*/
70-
void NMI_Handler(void)
71-
{
72-
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
73-
74-
/* USER CODE END NonMaskableInt_IRQn 0 */
75-
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
76-
while (1)
77-
{
78-
}
79-
/* USER CODE END NonMaskableInt_IRQn 1 */
80-
}
81-
82-
/**
83-
* @brief This function handles Hard fault interrupt.
84-
*/
85-
void HardFault_Handler(void)
86-
{
87-
/* USER CODE BEGIN HardFault_IRQn 0 */
88-
89-
/* USER CODE END HardFault_IRQn 0 */
90-
while (1)
91-
{
92-
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
93-
/* USER CODE END W1_HardFault_IRQn 0 */
94-
}
95-
}
96-
97-
/**
98-
* @brief This function handles System service call via SWI instruction.
99-
*/
100-
void SVC_Handler(void)
101-
{
102-
/* USER CODE BEGIN SVC_IRQn 0 */
103-
104-
/* USER CODE END SVC_IRQn 0 */
105-
/* USER CODE BEGIN SVC_IRQn 1 */
106-
107-
/* USER CODE END SVC_IRQn 1 */
108-
}
109-
110-
/**
111-
* @brief This function handles Pendable request for system service.
112-
*/
113-
void PendSV_Handler(void)
114-
{
115-
/* USER CODE BEGIN PendSV_IRQn 0 */
116-
117-
/* USER CODE END PendSV_IRQn 0 */
118-
/* USER CODE BEGIN PendSV_IRQn 1 */
119-
120-
/* USER CODE END PendSV_IRQn 1 */
121-
}
122-
123-
/**
124-
* @brief This function handles System tick timer.
125-
*/
126-
void SysTick_Handler(void)
127-
{
128-
/* USER CODE BEGIN SysTick_IRQn 0 */
129-
130-
/* USER CODE END SysTick_IRQn 0 */
131-
HAL_IncTick();
132-
/* USER CODE BEGIN SysTick_IRQn 1 */
133-
134-
/* USER CODE END SysTick_IRQn 1 */
135-
}
136-
137-
/******************************************************************************/
138-
/* STM32G0xx Peripheral Interrupt Handlers */
139-
/* Add here the Interrupt Handlers for the used peripherals. */
140-
/* For the available peripheral interrupt handler names, */
141-
/* please refer to the startup file (startup_stm32g0xx.s). */
142-
/******************************************************************************/
143-
144-
/* USER CODE BEGIN 1 */
145-
146-
/* USER CODE END 1 */
147-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
1+
/* USER CODE BEGIN Header */
2+
/**
3+
******************************************************************************
4+
* @file stm32g0xx_it.c
5+
* @brief Interrupt Service Routines.
6+
******************************************************************************
7+
* @attention
8+
*
9+
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
10+
* All rights reserved.</center></h2>
11+
*
12+
* This software component is licensed by ST under BSD 3-Clause license,
13+
* the "License"; You may not use this file except in compliance with the
14+
* License. You may obtain a copy of the License at:
15+
* opensource.org/licenses/BSD-3-Clause
16+
*
17+
******************************************************************************
18+
*/
19+
/* USER CODE END Header */
20+
21+
/* Includes ------------------------------------------------------------------*/
22+
#include "stm32g0xx_it.h"
23+
#include "main.h"
24+
/* Private includes ----------------------------------------------------------*/
25+
/* USER CODE BEGIN Includes */
26+
#include "STM32_common.h"
27+
/* USER CODE END Includes */
28+
29+
/* Private typedef -----------------------------------------------------------*/
30+
/* USER CODE BEGIN TD */
31+
32+
/* USER CODE END TD */
33+
34+
/* Private define ------------------------------------------------------------*/
35+
/* USER CODE BEGIN PD */
36+
37+
/* USER CODE END PD */
38+
39+
/* Private macro -------------------------------------------------------------*/
40+
/* USER CODE BEGIN PM */
41+
42+
/* USER CODE END PM */
43+
44+
/* Private variables ---------------------------------------------------------*/
45+
/* USER CODE BEGIN PV */
46+
47+
/* USER CODE END PV */
48+
49+
/* Private function prototypes -----------------------------------------------*/
50+
/* USER CODE BEGIN PFP */
51+
52+
/* USER CODE END PFP */
53+
54+
/* Private user code ---------------------------------------------------------*/
55+
/* USER CODE BEGIN 0 */
56+
57+
/* USER CODE END 0 */
58+
59+
/* External variables --------------------------------------------------------*/
60+
61+
/* USER CODE BEGIN EV */
62+
63+
/* USER CODE END EV */
64+
65+
/******************************************************************************/
66+
/* Cortex-M0+ Processor Interruption and Exception Handlers */
67+
/******************************************************************************/
68+
/**
69+
* @brief This function handles Non maskable interrupt.
70+
*/
71+
void NMI_Handler(void) {
72+
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
73+
74+
/* USER CODE END NonMaskableInt_IRQn 0 */
75+
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
76+
while (1) {
77+
}
78+
/* USER CODE END NonMaskableInt_IRQn 1 */
79+
}
80+
81+
/**
82+
* @brief This function handles Hard fault interrupt.
83+
*/
84+
void HardFault_Handler(void) {
85+
/* USER CODE BEGIN HardFault_IRQn 0 */
86+
printf("[error]: Hard fault. Please reset the device.\r\n");
87+
/* USER CODE END HardFault_IRQn 0 */
88+
while (1) {
89+
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
90+
/* USER CODE END W1_HardFault_IRQn 0 */
91+
}
92+
}
93+
94+
/**
95+
* @brief This function handles System service call via SWI instruction.
96+
*/
97+
void SVC_Handler(void) {
98+
/* USER CODE BEGIN SVC_IRQn 0 */
99+
100+
/* USER CODE END SVC_IRQn 0 */
101+
/* USER CODE BEGIN SVC_IRQn 1 */
102+
103+
/* USER CODE END SVC_IRQn 1 */
104+
}
105+
106+
/**
107+
* @brief This function handles Pendable request for system service.
108+
*/
109+
void PendSV_Handler(void) {
110+
/* USER CODE BEGIN PendSV_IRQn 0 */
111+
112+
/* USER CODE END PendSV_IRQn 0 */
113+
/* USER CODE BEGIN PendSV_IRQn 1 */
114+
115+
/* USER CODE END PendSV_IRQn 1 */
116+
}
117+
118+
/**
119+
* @brief This function handles System tick timer.
120+
*/
121+
void SysTick_Handler(void) {
122+
/* USER CODE BEGIN SysTick_IRQn 0 */
123+
124+
/* USER CODE END SysTick_IRQn 0 */
125+
HAL_IncTick();
126+
/* USER CODE BEGIN SysTick_IRQn 1 */
127+
STM32_Code_flashHandler();
128+
/* USER CODE END SysTick_IRQn 1 */
129+
}
130+
131+
/******************************************************************************/
132+
/* STM32G0xx Peripheral Interrupt Handlers */
133+
/* Add here the Interrupt Handlers for the used peripherals. */
134+
/* For the available peripheral interrupt handler names, */
135+
/* please refer to the startup file (startup_stm32g0xx.s). */
136+
/******************************************************************************/
137+
138+
/* USER CODE BEGIN 1 */
139+
140+
/* USER CODE END 1 */
141+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

demo/stm32g030c8/MDK-ARM/stm32g030c8.uvprojx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<TargetCommonOption>
1717
<Device>STM32G030C8Tx</Device>
1818
<Vendor>STMicroelectronics</Vendor>
19-
<PackID>Keil.STM32G0xx_DFP.1.2.0</PackID>
19+
<PackID>Keil.STM32G0xx_DFP.1.3.0</PackID>
2020
<PackURL>http://www.keil.com/pack/</PackURL>
2121
<Cpu>IRAM(0x20000000-0x20001FFF) IROM(0x8000000-0x800FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+") TZ</Cpu>
2222
<FlashUtilSpec></FlashUtilSpec>
@@ -313,7 +313,7 @@
313313
</ArmAdsMisc>
314314
<Cads>
315315
<interw>1</interw>
316-
<Optim>7</Optim>
316+
<Optim>1</Optim>
317317
<oTime>0</oTime>
318318
<SplitLS>0</SplitLS>
319319
<OneElfS>1</OneElfS>
@@ -332,7 +332,7 @@
332332
<v6LangP>3</v6LangP>
333333
<vShortEn>1</vShortEn>
334334
<vShortWch>1</vShortWch>
335-
<v6Lto>1</v6Lto>
335+
<v6Lto>0</v6Lto>
336336
<v6WtE>0</v6WtE>
337337
<v6Rtti>0</v6Rtti>
338338
<VariousControls>
@@ -800,6 +800,11 @@
800800
<FileType>4</FileType>
801801
<FilePath>..\pikascript\pikascript-lib\PikaPiZero\RGB_ASM.lib</FilePath>
802802
</File>
803+
<File>
804+
<FileName>STM32_Code.c</FileName>
805+
<FileType>1</FileType>
806+
<FilePath>..\pikascript\pikascript-lib\STM32\STM32_Code.c</FilePath>
807+
</File>
803808
</Files>
804809
</Group>
805810
<Group>

demo/stm32g030c8/pikascript/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
import PikaStdLib
44
time = STM32.Time()
55
uart = STM32.UART()
6+
rgb = PikaPiZero.RGB()
7+
mem = PikaStdLib.MemChecker()
68

79
uart.init()
810
uart.setId(1)
11+
uart.setBaudRate(115200)
912
uart.enable()
1013

1114
print('initing rgb...')
12-
rgb = PikaPiZero.RGB()
1315
rgb.init()
1416
rgb.enable()
1517
print('init rgb ok!')
1618

17-
mem = PikaStdLib.MemChecker()
1819
print('mem max:')
1920
mem.max()
2021
while True:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import STM32
2+
import PikaPiZero
3+
import PikaStdLib
4+
5+
uart.init()
6+
uart.setId(1)
7+
uart.setBaudRate(115200)
8+
uart.enable()
9+
10+
rgb.init()
11+
rgb.enable()
12+
13+
print('hello 2')
14+
15+
while True:
16+
time.sleep_ms(50)
17+
rgb.flow()

demo/stm32g030c8/pikascript/pikascript-api/compiler-info.txt

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)