Skip to content

Commit cc4964f

Browse files
committed
firmware: move trigger_enable to clock_gen.h|c
1 parent a37f8be commit cc4964f

5 files changed

Lines changed: 20 additions & 18 deletions

File tree

firmware/common/clock_gen.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <stdint.h>
2525

26+
#include "gpio.h"
2627
#include "hackrf_core.h"
2728
#include "hackrf_ui.h"
2829
#include "i2c_bus.h"
@@ -427,6 +428,20 @@ fp_28_36_t sample_rate_set(const fp_28_36_t sample_rate, const bool program)
427428
return resultant_rate;
428429
}
429430

431+
void trigger_enable(const bool enable)
432+
{
433+
#ifdef IS_NOT_PRALINE
434+
if (IS_NOT_PRALINE) {
435+
gpio_write(sgpio_config.gpio_trigger_enable, enable);
436+
}
437+
#endif
438+
#ifdef IS_PRALINE
439+
if (IS_PRALINE) {
440+
fpga_set_trigger_enable(&fpga, enable);
441+
}
442+
#endif
443+
}
444+
430445
#ifdef IS_PRALINE
431446
void p1_ctrl_set(const p1_ctrl_signal_t signal)
432447
{

firmware/common/clock_gen.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ clock_source_t activate_best_clock_source(void);
4747

4848
fp_28_36_t sample_rate_set(const fp_28_36_t sample_rate, const bool program);
4949

50+
void trigger_enable(const bool enable);
51+
5052
#ifdef IS_PRALINE
5153
typedef enum {
5254
P1_SIGNAL_TRIGGER_IN = 0,

firmware/common/hackrf_core.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Boston, MA 02110-1301, USA.
2222
*/
2323

24+
#include <stdbool.h>
25+
2426
#include <libopencm3/lpc43xx/memorymap.h>
2527
#include <libopencm3/lpc43xx/scu.h>
2628
#include <libopencm3/lpc43xx/ssp.h>
@@ -514,17 +516,3 @@ void pin_setup(void)
514516

515517
sgpio_configure_pin_functions(&sgpio_config);
516518
}
517-
518-
void trigger_enable(const bool enable)
519-
{
520-
#ifdef IS_NOT_PRALINE
521-
if (IS_NOT_PRALINE) {
522-
gpio_write(sgpio_config.gpio_trigger_enable, enable);
523-
}
524-
#endif
525-
#ifdef IS_PRALINE
526-
if (IS_PRALINE) {
527-
fpga_set_trigger_enable(&fpga, enable);
528-
}
529-
#endif
530-
}

firmware/common/hackrf_core.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
extern "C" {
2828
#endif
2929

30-
#include <stdbool.h>
31-
3230
#include "cpld_jtag.h"
3331
#include "i2c_bus.h"
3432
#include "i2c_lpc.h"
@@ -76,8 +74,6 @@ void ssp1_set_mode_ice40(void);
7674
void pin_shutdown(void);
7775
void pin_setup(void);
7876

79-
void trigger_enable(const bool enable);
80-
8177
#ifdef __cplusplus
8278
}
8379
#endif

firmware/common/radio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <libopencm3/cm3/nvic.h>
2727

28+
#include "clock_gen.h"
2829
#include "fixed_point.h"
2930
#include "hackrf_core.h"
3031
#include "mixer.h"

0 commit comments

Comments
 (0)