summaryrefslogtreecommitdiff
path: root/project/Core/Src/Activties
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-12-10 17:49:22 -0500
committersowgro <tpoke.ferrari@gmail.com>2025-12-10 17:49:22 -0500
commit29f69b5b7831c846cea1f61a7de4920fafa97ede (patch)
treea216cbcef9306ab5707752d8eec33f5a5a682744 /project/Core/Src/Activties
parent9db025199644833d70e729d03e6151f8cce58ed5 (diff)
download340-repo-Sowgro-29f69b5b7831c846cea1f61a7de4920fafa97ede.tar.gz
340-repo-Sowgro-29f69b5b7831c846cea1f61a7de4920fafa97ede.tar.bz2
340-repo-Sowgro-29f69b5b7831c846cea1f61a7de4920fafa97ede.zip
push for laptop
Diffstat (limited to 'project/Core/Src/Activties')
-rw-r--r--project/Core/Src/Activties/activity4.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/project/Core/Src/Activties/activity4.c b/project/Core/Src/Activties/activity4.c
index f3bd673..898cd2d 100644
--- a/project/Core/Src/Activties/activity4.c
+++ b/project/Core/Src/Activties/activity4.c
@@ -12,19 +12,23 @@
#include "activity4.h"
void activity4_run() {
- header_t* p_header;
+ header_t* p_header = get_header(get_song(0).p_song);
- p_header = (header_t *) (get_song(0).p_song);
+ printf ("Header: \r\n");
+ printf ("\tLength: %lu\r\n", p_header->length);
+ printf ("\tFormat: %u\r\n", p_header->format);
+ printf ("\tNum Tracks: %u\r\n", p_header->ntrcks);
+ printf ("\tDivision: %u\r\n", p_header->division);
+}
+
+header_t get_header(uint8_t *p_song) {
+ header_t* p_header = (header_t *) (p_song);
p_header->length = convert_to_uint32((uint8_t*) &p_header->length);
p_header->format = convert_to_uint16((uint8_t*) &p_header->format);
p_header->ntrcks = convert_to_uint16((uint8_t*) &p_header->ntrcks);
p_header->division = convert_to_uint16((uint8_t*) &p_header->division);
- printf ("Header: \r\n");
- printf ("\tLength: %lu\r\n", p_header->length);
- printf ("\tFormat: %u\r\n", p_header->format);
- printf ("\tNum Tracks: %u\r\n", p_header->ntrcks);
- printf ("\tDivision: %u\r\n", p_header->division);
+ return *p_header;
}