From a64275b5edcf56b7aa4628327a70aa90caf67827 Mon Sep 17 00:00:00 2001 From: Daniel Giritzer Date: Fri, 2 Jun 2017 22:33:08 +0200 Subject: [PATCH] Swapped x and y as cmdlineparameters --- src/main.c | 11 ++++++----- src/tvout.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 9278d78..b630404 100644 --- a/src/main.c +++ b/src/main.c @@ -2,7 +2,8 @@ // Workfile: tvout.c (Implementation) // Author: Daniel Giritzer // Date: 2017-06-02 -// Description: Simple Program to move the +// Description: Simple Program to move the picture of the composite video +// output. // Remarks: - // Revision: 1 // Copyright (C) 2017, Daniel Giritzer (giri@nwrk.biz) @@ -22,17 +23,17 @@ int main(int argc, char **argv) if(argc != 3) { fprintf(stdout, "Usage: tvout \n"); - fprintf(stdout, "The parameter values should be in px.\n"); + fprintf(stdout, "The parameter values should be in px.\n\n"); fprintf(stdout, "This program was created for the Armbian Project."); - fprintf(stdout, "(c) 2017, Daniel G."); + fprintf(stdout, "(c) 2017, Daniel G.\n"); return EXIT_SUCCESS; } //Set X value - to_write = strtoul(argv[1], 0, 0) << X_REG_OFFSET; + to_write += strtoul(argv[1], 0, 0) << X_REG_OFFSET; //Set Y value - to_write = strtoul(argv[2], 0, 0) << Y_REG_OFFSET; + to_write += strtoul(argv[2], 0, 0) << Y_REG_OFFSET; //write to register writemem(TV_ENCODER_RESYNC, to_write, 'w'); diff --git a/src/tvout.h b/src/tvout.h index 69e7b6e..9837fe4 100644 --- a/src/tvout.h +++ b/src/tvout.h @@ -12,7 +12,7 @@ #define TV_ENCODER_BASE 0x01E00000 #define TV_ENCODER_RESYNC TV_ENCODER_BASE + 0x130 -#define X_REG_OFFSET 16 +#define X_REG_OFFSET 15 #define Y_REG_OFFSET 0 #endif // TVOUT_H_INCLUDED -- 2.11.0