Moved /* Enable Ethernet MAC */ block into vInitMCU(void)

Defined ipconfigSUPPORT_SIGNALS 1
This commit is contained in:
Alexey Bazlaev 2023-02-10 18:58:59 +07:00
parent 6515b14c30
commit d828d31f23
4 changed files with 137 additions and 64 deletions

View File

@ -43,7 +43,9 @@
#define ipconfigUSE_DHCP 1
#define ipconfigUSE_DHCP_HOOK 1
#define ipconfigUSE_DNS_CACHE 1
#define ipconfigSUPPORT_SIGNALS 1
#ifdef DEBUG
#define ipconfigHAS_DEBUG_PRINTF 1
#define ipconfigHAS_PRINTF 1
#define FreeRTOS_debug_printf( X ) printf X//, ##__VA_ARGS__

File diff suppressed because one or more lines are too long

View File

@ -157,7 +157,7 @@
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>202</LineNumber>
<LineNumber>1008</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
@ -166,14 +166,14 @@
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\DemoTasks\SimpleTCPEchoServer.c</Filename>
<Filename>.\FreeRTOS\source\FreeRTOS_Sockets.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>205</LineNumber>
<LineNumber>967</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
@ -182,7 +182,23 @@
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\DemoTasks\SimpleTCPEchoServer.c</Filename>
<Filename>.\FreeRTOS\source\FreeRTOS_Sockets.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>865</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\FreeRTOS\source\FreeRTOS_Sockets.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
@ -363,7 +379,7 @@
<Group>
<GroupName>FreeRTOS</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -635,7 +651,7 @@
<GroupNumber>2</GroupNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\FreeRTOS\source\portable\NetworkInterface\board_family\NetworkInterface.c</PathWithFileName>
@ -683,7 +699,7 @@
<Group>
<GroupName>::Device</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>

22
main.c
View File

@ -191,15 +191,17 @@ static void vInitMCU(void)
rcu_periph_clock_enable(RCU_ENETTX);
rcu_periph_clock_enable(RCU_ENETRX);
rcu_periph_clock_enable(RCU_RTC);
rcu_rtc_clock_config(RCU_RTCSRC_LXTAL);
/* Configure RTC */
#ifdef RTC_ENABLE
rcu_rtc_clock_config(RCU_RTCSRC_LXTAL);
rtc_configuration_mode_enter();
rtc_lwoff_wait();
rtc_counter_set(0xA5A5A5A5);
//rtc_lwoff_wait();
rtc_configuration_mode_exit();
#endif
/* Configure GPIO Alternate UART function */
gd_eval_com_init(EVAL_COM1);
@ -234,6 +236,11 @@ static void vInitMCU(void)
gpio_init(RMII_RXD_PORT, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, RMII_RXD1);
gpio_init(RMII_CRS_DV_PORT, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, RMII_CRS_DV);
/* Enable Ethernet MAC */
enet_descriptors_chain_init(ENET_DMA_TX);
enet_descriptors_chain_init(ENET_DMA_RX);
enet_enable();
}
/**! \brief vTaskHelloWorld procedure
@ -276,7 +283,10 @@ void vTaskToggleLed( void *pvParameters)
}
}
/**
* @brief Miscellaneous initialisation including preparing the logging and seeding
* the random number generator.
*/
static void prvMiscInitialisation( void )
{
UBaseType_t xTimeNow;
@ -301,15 +311,11 @@ static void prvMiscInitialisation( void )
int main(void)
{
vInitMCU();
/* Miscellaneous initialisation including preparing the logging and seeding
* the random number generator. */
prvMiscInitialisation();
xTaskCreate( vTaskToggleLed, "ToggleLed", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+1, NULL);
xTaskCreate( vTaskHelloWorld, "HelloWorld", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+1, NULL);
FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );
enet_descriptors_chain_init(ENET_DMA_TX);
enet_descriptors_chain_init(ENET_DMA_RX);
enet_enable();
vTaskStartScheduler();
while(1);
}