main.c 944 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Project: Arrow
  3. * Author: curiousmuch
  4. */
  5. #include <stdio.h>
  6. #include "freertos/FreeRTOS.h"
  7. #include "freertos/task.h"
  8. #include "driver/gpio.h"
  9. #include "sdkconfig.h"
  10. #include "esp_task_wdt.h"
  11. #include "cc1120.h"
  12. #include "cc1120_protocol.h"
  13. #include "board.h"
  14. #include "ax25_pad2.h"
  15. #include "ax25_pad.h"
  16. #include "fcs_calc.h"
  17. extern uint8_t tx_symbol;
  18. extern uint8_t sample_count;
  19. void IRAM_ATTR app_main()
  20. {
  21. cc1120_radio_init(APRS_SETTINGS, sizeof(APRS_SETTINGS)/sizeof(cc1120_reg_settings_t));
  22. vTaskDelay(500/portTICK_PERIOD_MS);
  23. // generate sample packet
  24. packet_t pp;
  25. unsigned char fbuf[AX25_MAX_PACKET_LEN+2];
  26. uint32_t flen;
  27. uint32_t c;
  28. pp = ax25_from_text("WB2OSZ-15>TEST:,The quick brown fox jumps over the lazy dog! 1 of 4", 1);
  29. flen = ax25_pack(pp, fbuf);
  30. uint32_t fcs = fcs_calc(fbuf, flen);
  31. ax25_hex_dump(pp);
  32. printf("FCS: %x\n", fcs);
  33. //cc1120_radio_APRSTXPacket();
  34. //xTaskCreatePinnedToCore();
  35. }