Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantic versioning #16

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <String.h>

#include "defines.h"
#include "version.h"
#include "config.h"
#include "uart.h"
#include "spi.h"
Expand All @@ -43,10 +44,6 @@
#include "clock.h"
#include "mos.h"

#define MOS_version 1
#define MOS_revision 4
#define MOS_rc 2

extern void * set_vector(unsigned int vector, void(*handler)(void));

extern void vblank_handler(void);
Expand Down Expand Up @@ -118,9 +115,13 @@ int main(void) {
if(coldBoot == 0) { // If a warm boot detected then
putch(12); // Clear the screen
}
printf("Agon Quark MOS Version %d.%02d", MOS_version, MOS_revision);
#if MOS_rc > 0
printf(" RC%d", MOS_rc);
printf("Agon %s MOS Version %d.%d.%d", VERSION_VARIANT, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
#if VERSION_CANDIDATE > 0
printf(" %s%d", VERSION_TYPE, VERSION_CANDIDATE);
#endif
// Show build if defined (intended to be auto-generated string from build script from git commit hash)
#ifdef VERSION_BUILD
printf(" Build %s", VERSION_BUILD);
#endif
printf("\n\r\n\r");
#if DEBUG > 0
Expand Down
12 changes: 12 additions & 0 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef VERSION_H
#define VERSION_H

#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_PATCH 0
#define VERSION_CANDIDATE 1 // Optional
#define VERSION_TYPE "Alpha " // RC, Alpha, Beta, etc.

#define VERSION_VARIANT "Console8"

#endif // VERSION_H