You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.0 KiB

  1. #include <stdbool.h>
  2. #include <stdint.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include "lwip/opt.h"
  6. #include "lwip/sys.h"
  7. #include "lwip/api.h"
  8. #include "main.h"
  9. #include "zport.h"
  10. #include "zboard.h"
  11. #include "encoder.h"
  12. #include "udpclient.h"
  13. #include "zflash.h"
  14. #include "config.h"
  15. HAL_StatusTypeDef flash_status;
  16. void user_main()
  17. {
  18. printf("==============ethernet_sound_acquisition_card=============\r\n");
  19. printf("version %d.%d", VERSION_MAIN_ID, VERSION_SUB_ID);
  20. encoder_start();
  21. udp_client_init();
  22. config_init();
  23. flash_status = FlashErase();
  24. if (flash_status != HAL_OK)
  25. {
  26. printf("flash erase error, flash_status:%d\r\n", flash_status);
  27. }
  28. flash_status = FlashWrite(FLASH_START_ADDRESS, 123456);
  29. if (flash_status != HAL_OK)
  30. {
  31. printf("flash write error, flash_status:%d\r\n", flash_status);
  32. }
  33. printf("flash read data:%d\r\n", FlashRead(FLASH_START_ADDRESS));
  34. while (1)
  35. {
  36. udp_client_recv();
  37. encoder_read_printf();
  38. port_do_debug_light_state();
  39. osDelay(1);
  40. }
  41. }