Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Add fw-acquisitions as a submodule
Browse files Browse the repository at this point in the history
- Point at version 2 branch, which is mostly empty.
- Remove uas_control files, replaces them with the fw-acquisition
  code.

 On branch master
 Changes to be committed:
	modified:   .gitmodules
	modified:   experiments/translation/nops/experiment.c
	modified:   experiments/translation/nops/experiment.h
	new file:   external/fw-acquisition
	modified:   target/share/Makefile.in
	deleted:    target/share/uas_control.c
	deleted:    target/share/uas_control.h
	modified:   target/share/uas_main.c
  • Loading branch information
ben-marshall committed May 8, 2019
1 parent 32e2112 commit 66ee772
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 101 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "external/scale-hw"]
path = external/scale-hw
url = https://github.com/danpage/scale-hw.git
[submodule "external/fw-acquisition"]
path = external/fw-acquisition
url = https://github.com/scarv/fw-acquisition.git
15 changes: 11 additions & 4 deletions experiments/translation/nops/experiment.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ extern void * experiment_payload_end;
@details Does nothing.
*/
uint8_t experiment_init() {
return UAS_RSP_OKAY;
return 0;
}

/*!
@brief Run the experiment once
@returns 0 if successful, non-zero otherwise.
@details Runs a bunch of NOPS in sequence, then finishes.
*/
uint8_t experiment_run(){

Expand All @@ -29,7 +28,15 @@ uint8_t experiment_run(){

uas_bsp_trigger_clear();

return UAS_RSP_OKAY;
return 0;

}

void experiment_setup_scass(
scass_target_cfg * cfg //!< The config object to setup.
){
cfg -> scass_experiment_init = experiment_init;
cfg -> scass_experiment_run = experiment_run ;
cfg -> experiment_name = "translation/nops";
}

9 changes: 8 additions & 1 deletion experiments/translation/nops/experiment.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@brief Experiment header file for the NOPS translation experiment.
*/

#include "uas_control.h"
#include "scass/scass_target.h"

#ifndef EXPERIMENT_H
#define EXPERIMENT_H
Expand All @@ -21,4 +21,11 @@ uint8_t experiment_init();
*/
uint8_t experiment_run();

/*!
@brief Responsible for configuring the scass communication object.
*/
void experiment_setup_scass(
scass_target_cfg * cfg //!< The config object to setup.
);

#endif
1 change: 1 addition & 0 deletions external/fw-acquisition
Submodule fw-acquisition added at 771464
4 changes: 3 additions & 1 deletion target/share/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

UAS_SRCS = $(UAS_ROOT)/target/share/uas_bsp.c \
$(UAS_ROOT)/target/share/uas_prng.c \
$(UAS_ROOT)/target/share/uas_control.c \
$(UAS_ROOT)/external/fw-acquisition/target/scass/scass_target.c \
$(UAS_ROOT)/target/share/uas_main.c

CFLAGS += -I$(UAS_ROOT)/external/fw-acquisition/target

62 changes: 0 additions & 62 deletions target/share/uas_control.c

This file was deleted.

31 changes: 0 additions & 31 deletions target/share/uas_control.h

This file was deleted.

16 changes: 14 additions & 2 deletions target/share/uas_main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

#include "scass/scass_target.h"

#include "uas_bsp.h"
#include "uas_control.h"

#include "experiment.h"

/*!
@brief The main function which runs the trigger program.
Expand All @@ -10,10 +13,19 @@ int main(int argc, char ** argv) {
// Configure the target platform
uint8_t setup_status = uas_bsp_init_target();

// The main configuration object for target/host communication
scass_target_cfg scass_cfg;

scass_cfg.scass_io_rd_char = uas_bsp_uart_rd_char;
scass_cfg.scass_io_wr_char = uas_bsp_uart_wr_char;

// Configure the scass config object before entering the main loop.
experiment_setup_scass(&scass_cfg);

if(setup_status == 0){

// Enter the control loop
uas_ctrl_loop();
scass_loop(&scass_cfg);

} else {

Expand Down

0 comments on commit 66ee772

Please sign in to comment.