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.

46 lines
991 B

  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. HAL_StatusTypeDef flash_status;
  15. void user_main()
  16. {
  17. encoder_start();
  18. udp_client_init();
  19. printf("==============ethernet_sound_acquisition_card=============\r\n");
  20. printf("version %d.%d", VERSION_MAIN_ID, VERSION_SUB_ID);
  21. flash_status = FlashErase();
  22. if (flash_status != HAL_OK)
  23. {
  24. printf("flash erase error, flash_status:%d\r\n", flash_status);
  25. }
  26. flash_status = FlashWrite(FLASH_START_ADDRESS, 123456);
  27. if (flash_status != HAL_OK)
  28. {
  29. printf("flash write error, flash_status:%d\r\n", flash_status);
  30. }
  31. printf("flash read data:%d\r\n", FlashRead(FLASH_START_ADDRESS));
  32. while (1)
  33. {
  34. udp_client_recv();
  35. encoder_read_printf();
  36. port_do_debug_light_state();
  37. osDelay(1);
  38. }
  39. }