Проект перенесен в папку MDK-ARM
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -46,4 +46,4 @@ JLinkSettings.ini
|
|||||||
|
|
||||||
# Other Files
|
# Other Files
|
||||||
|
|
||||||
/Objects/
|
MDK-ARM/Objects/
|
||||||
|
|||||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,4 +1,4 @@
|
|||||||
[submodule "Core/ExtendedLibs"]
|
[submodule "MDK-ARM/Core/ExtendedLibs"]
|
||||||
path = Core/ExtendedLibs
|
path = MDK-ARM/Core/ExtendedLibs
|
||||||
url = https://git.arktika.cyou/Razvalyaev/STM32_ExtendedLibs.git
|
url = https://git.arktika.cyou/Razvalyaev/STM32_ExtendedLibs.git
|
||||||
branch = release
|
branch = develop
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
/*==============================================================================
|
|
||||||
* Шаблон проекта для К1921ВК035 с использованием бибилотеки PLIB035
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
* ЦНИИ СЭТ, Разваляев Алексей <wot890089@mail.ru>
|
|
||||||
*==============================================================================
|
|
||||||
* ЦНИИ СЭТ
|
|
||||||
*==============================================================================
|
|
||||||
*/
|
|
||||||
|
|
||||||
//-- Includes ------------------------------------------------------------------
|
|
||||||
#include "main.h"
|
|
||||||
|
|
||||||
//-- Defines -------------------------------------------------------------------
|
|
||||||
|
|
||||||
//-- Peripheral init functions -------------------------------------------------
|
|
||||||
void periph_init()
|
|
||||||
{
|
|
||||||
sysclk_init();
|
|
||||||
uart_init_first();
|
|
||||||
adc_init_first();
|
|
||||||
tmr_init_first();
|
|
||||||
gpio_init();
|
|
||||||
#ifdef RETARGET
|
|
||||||
retarget_init();
|
|
||||||
#endif
|
|
||||||
NVIC_SetAllPriorities();
|
|
||||||
printf("\nAll peripherals inited, SYSCLK = %3d MHz\n", (int)(SystemCoreClock / 1E6));
|
|
||||||
}
|
|
||||||
|
|
||||||
//-- Main ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
periph_init();
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
//return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-- Assert --------------------------------------------------------------------
|
|
||||||
void Error_Handler(void)
|
|
||||||
{
|
|
||||||
__disable_irq();
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined USE_FULL_ASSERT
|
|
||||||
void assert_failed(uint8_t* file, uint32_t line)
|
|
||||||
{
|
|
||||||
printf("Assert failed: file %s on line %d\n", file, (int)line);
|
|
||||||
while (1) {
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif /* USE_FULL_ASSERT */
|
|
||||||
Submodule Core/ExtendedLibs deleted from 457ec2a729
104
MDK-ARM/Core/App/main.c
Normal file
104
MDK-ARM/Core/App/main.c
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
/*==============================================================================
|
||||||
|
* Шаблон проекта для К1921ВК035 с использованием бибилотеки PLIB035
|
||||||
|
*------------------------------------------------------------------------------
|
||||||
|
* ЦНИИ СЭТ, Разваляев Алексей <wot890089@mail.ru>
|
||||||
|
*==============================================================================
|
||||||
|
* ЦНИИ СЭТ
|
||||||
|
*==============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
//-- Includes ------------------------------------------------------------------
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
void restart_receive(void);
|
||||||
|
void heartbit(void);
|
||||||
|
//-- Defines -------------------------------------------------------------------
|
||||||
|
uint8_t rxbuff[10] = {0};
|
||||||
|
uint8_t txbuff[20] = {0};
|
||||||
|
uint16_t seq0_buff[2][100] = {0};
|
||||||
|
uint16_t seq1_buff[2][100] = {0};
|
||||||
|
//-- Peripheral init functions -------------------------------------------------
|
||||||
|
void periph_init()
|
||||||
|
{
|
||||||
|
sysclk_init();
|
||||||
|
uart_init_first();
|
||||||
|
adc_init_first();
|
||||||
|
tmr_init_first();
|
||||||
|
gpio_init();
|
||||||
|
#ifdef RETARGET
|
||||||
|
retarget_init();
|
||||||
|
#endif
|
||||||
|
NVIC_SetAllPriorities();
|
||||||
|
printf("\nAll peripherals inited, SYSCLK = %3d MHz\n", (int)(SystemCoreClock / 1E6));
|
||||||
|
|
||||||
|
|
||||||
|
UART_Start(&huart1, UART_FIFOLevel_1_8, UART_FIFOLevel_1_8);
|
||||||
|
|
||||||
|
// TMR_Set_Callback(&htmr2, TMR_Callback_Update, &heartbit);
|
||||||
|
TMR_Start(&htmr0, DISABLE);
|
||||||
|
TMR_Start(&htmr1, DISABLE);
|
||||||
|
TMR_Start(&htmr2, ENABLE);
|
||||||
|
ADC_SEQ_Set_Callback(&hadc, ADC_SEQ_Num_1, ADC_Callback_SeqCplt, &heartbit);
|
||||||
|
// ADC_SEQ_Start(&hadc, ADC_SEQ_Num_0, seq0_buff, 100);
|
||||||
|
ADC_SEQ_Start(&hadc, ADC_SEQ_Num_1, NULL, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-- Main ----------------------------------------------------------------------
|
||||||
|
uint32_t startmillis = 0;
|
||||||
|
uint32_t prev_tick;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
periph_init();
|
||||||
|
|
||||||
|
// UART_Receive_IT(&huart1, rxbuff, sizeof(rxbuff));
|
||||||
|
TMR_Delay_Start(&htmr0, &prev_tick);
|
||||||
|
ADC_SEQ_SoftwareStart();
|
||||||
|
while (1) {
|
||||||
|
if(TMR_Delay_Done(&htmr0, 2000000, &prev_tick))
|
||||||
|
{
|
||||||
|
TMR_Delay_Start(&htmr0, &prev_tick);
|
||||||
|
GPIO_ToggleBits(GPIOA, GPIO_Pin_8);
|
||||||
|
startmillis = millis();
|
||||||
|
// ADC_SEQ_SoftwareStart();
|
||||||
|
}
|
||||||
|
TMR_Delay(&htmr0, 100000);
|
||||||
|
// GPIO_ToggleBits(GPIOA, GPIO_Pin_7);
|
||||||
|
// UART_Transmit_IT(&huart1, (uint8_t*)"Hello World: ", sizeof("Hello World: ")-1);
|
||||||
|
// int len = sprintf((char*)txbuff, "\r\nValue: %d", ADC_Channel_GetValue(&hadc, ADC_CH_Num_3));
|
||||||
|
// UART_Transmit_IT(&huart1, txbuff, len);
|
||||||
|
};
|
||||||
|
//return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void restart_receive(void)
|
||||||
|
{
|
||||||
|
// UART_Receive_IT(&huart1, rxbuff, sizeof(rxbuff));
|
||||||
|
// UART_Transmit_IT(&huart1, rxbuff, sizeof(rxbuff));
|
||||||
|
}
|
||||||
|
|
||||||
|
char tickbuff[40] = {0};
|
||||||
|
void heartbit(void)
|
||||||
|
{
|
||||||
|
static uint32_t prev_tick = 0;
|
||||||
|
int len = sprintf(tickbuff, "\r\nTick: %d, Value: %d", TMR_Get_Cnt(&htmr0) - prev_tick, ADC_Channel_GetValue(&hadc, ADC_CH_Num_3));
|
||||||
|
prev_tick = TMR_Get_Cnt(&htmr0);
|
||||||
|
UART_Transmit_IT(&huart1, (uint8_t *)tickbuff, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-- Assert --------------------------------------------------------------------
|
||||||
|
void Error_Handler(void)
|
||||||
|
{
|
||||||
|
__disable_irq();
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined USE_FULL_ASSERT
|
||||||
|
void assert_failed(uint8_t* file, uint32_t line)
|
||||||
|
{
|
||||||
|
printf("Assert failed: file %s on line %d\n", file, (int)line);
|
||||||
|
while (1) {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endif /* USE_FULL_ASSERT */
|
||||||
1
MDK-ARM/Core/ExtendedLibs
Submodule
1
MDK-ARM/Core/ExtendedLibs
Submodule
Submodule MDK-ARM/Core/ExtendedLibs added at 795ebbd220
@@ -77,7 +77,7 @@
|
|||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<IsCurrentTarget>1</IsCurrentTarget>
|
<IsCurrentTarget>1</IsCurrentTarget>
|
||||||
</OPTFL>
|
</OPTFL>
|
||||||
<CpuCode>0</CpuCode>
|
<CpuCode>255</CpuCode>
|
||||||
<DebugOpt>
|
<DebugOpt>
|
||||||
<uSim>0</uSim>
|
<uSim>0</uSim>
|
||||||
<uTrg>1</uTrg>
|
<uTrg>1</uTrg>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user