Rockbox Development > New Ports

SanDisk Sansa c200v2, m200v4, clipv1, clipv2, clip+, and fuzev2

<< < (284/386) > >>

ranma:
Battery bench on my c240v2:


--- Quote ---Battery bench run for Sandisk Sansa c200v2 series version

Battery type: -352317087 mAh      Buffer Entries: 1000
  Time:,  Seconds:,  Level:,  Time Left:,  Voltage[mV]:, C:, S:, U:
00:02:15,  00135,     000%,     00:01,         4960,     A,  -,  -
00:03:15,  00195,     000%,     00:01,         5024,     A,  -,  -
00:04:15,  00255,     000%,     00:01,         5024,     A,  -,  -
00:05:15,  00315,     000%,     00:01,         5024,     A,  -,  -
00:06:15,  00375,     000%,     00:01,         4960,     A,  -,  -
00:07:15,  00435,     000%,     00:01,         4960,     A,  -,  -
00:08:15,  00495,     000%,     00:01,         4960,     A,  -,  -
00:09:15,  00555,     000%,     00:01,         4960,     A,  -,  -
00:10:15,  00615,     000%,     00:01,         4897,     A,  -,  -
00:11:15,  00675,     000%,     00:01,         4897,     A,  -,  -
00:12:15,  00735,     000%,     00:01,         4897,     A,  -,  -
00:13:15,  00795,     000%,     00:01,         4833,     A,  -,  -
00:14:15,  00855,     000%,     00:01,         4833,     A,  -,  -
00:15:15,  00915,     000%,     00:01,         4833,     A,  -,  -
00:16:16,  00976,     000%,     00:01,         4833,     A,  -,  -
00:17:16,  01036,     000%,     00:01,         4770,     A,  -,  -
00:18:16,  01096,     000%,     00:01,         4770,     A,  -,  -
00:19:16,  01156,     000%,     00:01,         4770,     A,  -,  -
00:20:16,  01216,     000%,     00:01,         4770,     A,  -,  -
00:21:16,  01276,     000%,     00:01,         4738,     A,  -,  -
00:22:16,  01336,     000%,     00:01,         4706,     A,  -,  -
00:23:16,  01396,     000%,     00:01,         4706,     A,  -,  -
00:24:16,  01456,     000%,     00:01,         4706,     A,  -,  -
00:25:16,  01516,     000%,     00:01,         4706,     A,  -,  -
00:26:16,  01576,     000%,     00:01,         4642,     A,  -,  -
00:27:16,  01636,     000%,     00:01,         4642,     A,  -,  -
00:28:16,  01696,     000%,     00:01,         4642,     A,  -,  -
00:29:16,  01756,     000%,     00:01,         4642,     A,  -,  -
00:30:16,  01816,     000%,     00:01,         4642,     A,  -,  -
00:31:16,  01876,     000%,     00:01,         4579,     A,  -,  -
00:32:16,  01936,     000%,     00:01,         4579,     A,  -,  -
00:33:16,  01996,     000%,     00:01,         4579,     A,  -,  -
00:34:16,  02056,     000%,     00:01,         4579,     A,  -,  -
00:35:16,  02116,     000%,     00:01,         4579,     A,  -,  -
00:36:16,  02176,     000%,     00:01,         4579,     A,  -,  -
00:37:16,  02236,     000%,     00:01,         4579,     A,  -,  -
00:38:16,  02296,     000%,     00:01,         4515,     A,  -,  -
00:39:16,  02356,     000%,     00:01,         4515,     A,  -,  -
00:40:16,  02416,     000%,     00:01,         4515,     A,  -,  -
00:41:16,  02476,     000%,     00:01,         4515,     A,  -,  -
00:42:16,  02536,     000%,     00:01,         4515,     A,  -,  -
00:43:17,  02597,     000%,     00:01,         4515,     A,  -,  -
00:44:17,  02657,     000%,     00:01,         4515,     A,  -,  -
00:45:17,  02717,     000%,     00:01,         4452,     A,  -,  -
00:46:17,  02777,     000%,     00:01,         4388,     A,  -,  -
00:47:17,  02837,     000%,     00:01,         4452,     A,  -,  -
00:48:17,  02897,     000%,     00:01,         4452,     A,  -,  -
00:49:17,  02957,     000%,     00:01,         4452,     A,  -,  -
00:50:17,  03017,     000%,     00:01,         4452,     A,  -,  -
00:51:17,  03077,     000%,     00:01,         4452,     A,  -,  -
00:52:17,  03137,     000%,     00:01,         4452,     A,  -,  -
00:53:17,  03197,     000%,     00:01,         4388,     A,  -,  -
00:54:17,  03257,     000%,     00:01,         4388,     A,  -,  -
00:55:17,  03317,     000%,     00:01,         4388,     A,  -,  -
00:56:17,  03377,     000%,     00:01,         4388,     A,  -,  -
00:57:17,  03437,     000%,     00:01,         4388,     A,  -,  -
00:58:17,  03497,     000%,     00:01,         4324,     A,  -,  -
00:59:17,  03557,     000%,     00:01,         4324,     A,  -,  -
01:00:17,  03617,     000%,     00:01,         4324,     A,  -,  -
01:01:17,  03677,     000%,     00:01,         4324,     A,  -,  -
01:02:17,  03737,     000%,     00:01,         4324,     A,  -,  -
01:03:17,  03797,     000%,     00:01,         4324,     A,  -,  -
01:04:17,  03857,     000%,     00:01,         4324,     A,  -,  -
01:05:17,  03917,     000%,     00:01,         4261,     A,  -,  -
01:06:17,  03977,     000%,     00:01,         4261,     A,  -,  -
01:07:17,  04037,     000%,     00:01,         4261,     A,  -,  -
01:08:17,  04097,     000%,     00:01,         4261,     A,  -,  -
01:09:17,  04157,     000%,     00:01,         4261,     A,  -,  -
01:10:18,  04218,     000%,     00:01,         4261,     A,  -,  -
01:11:18,  04278,     000%,     00:01,         4261,     A,  -,  -
01:12:18,  04338,     000%,     00:01,         4261,     A,  -,  -
01:13:18,  04398,     000%,     00:01,         4261,     A,  -,  -
01:14:18,  04458,     000%,     00:01,         4197,     A,  -,  -
01:15:18,  04518,     000%,     00:01,         4197,     A,  -,  -
01:16:18,  04578,     000%,     00:01,         4197,     A,  -,  -
01:17:18,  04638,     000%,     00:01,         4197,     A,  -,  -
01:18:18,  04698,     000%,     00:01,         4197,     A,  -,  -
01:19:18,  04758,     000%,     00:01,         4134,     A,  -,  -
01:20:18,  04818,     000%,     00:01,         4134,     A,  -,  -
01:21:18,  04878,     000%,     00:01,         4134,     A,  -,  -
01:22:18,  04938,     000%,     00:01,         4070,     A,  -,  -
01:23:18,  04998,     000%,     00:01,         4134,     A,  -,  -
01:24:18,  05058,     000%,     00:01,         4134,     A,  -,  -
01:25:18,  05118,     000%,     00:01,         4070,     A,  -,  -
01:26:18,  05178,     000%,     00:01,         4070,     A,  -,  -
01:27:18,  05238,     000%,     00:01,         4070,     A,  -,  -
01:28:18,  05298,     000%,     00:01,         4006,     A,  -,  -
01:29:18,  05358,     000%,     00:01,         4006,     A,  -,  -
01:30:18,  05418,     000%,     00:01,         4006,     A,  -,  -
01:31:18,  05478,     000%,     00:01,         4006,     A,  -,  -
01:32:18,  05538,     000%,     00:01,         3943,     A,  -,  -
01:33:18,  05598,     000%,     00:01,         3943,     A,  -,  -
01:34:18,  05658,     000%,     00:01,         3752,     A,  -,  -
01:35:18,  05718,     000%,     00:01,         3879,     A,  -,  -
01:36:18,  05778,     000%,     00:01,         3879,     A,  -,  -
01:37:18,  05838,     000%,     00:01,         3879,     A,  -,  -
01:38:19,  05899,     000%,     00:01,         3816,     A,  -,  -
01:39:19,  05959,     000%,     00:01,         3816,     A,  -,  -
01:40:19,  06019,     000%,     00:01,         3816,     A,  -,  -
01:41:19,  06079,     000%,     00:01,         3816,     A,  -,  -
01:42:19,  06139,     000%,     00:01,         3752,     A,  -,  -
01:43:19,  06199,     000%,     00:01,         3752,     A,  -,  -
01:44:19,  06259,     000%,     00:01,         3752,     A,  -,  -
01:45:19,  06319,     000%,     00:01,         3688,     A,  -,  -
01:46:19,  06379,     000%,     00:01,         3688,     A,  -,  -
01:47:19,  06439,     000%,     00:01,         3688,     A,  -,  -
01:48:19,  06499,     000%,     00:01,         3688,     A,  -,  -
01:49:19,  06559,     000%,     00:01,         3625,     A,  -,  -
01:50:19,  06619,     000%,     00:01,         3625,     A,  -,  -
01:51:19,  06679,     000%,     00:01,         3625,     A,  -,  -
01:52:19,  06739,     000%,     00:01,         3625,     A,  -,  -
01:53:19,  06799,     000%,     00:01,         3561,     A,  -,  -
01:54:19,  06859,     000%,     00:01,         3561,     A,  -,  -
01:55:19,  06919,     000%,     00:01,         3561,     A,  -,  -
01:56:19,  06979,     000%,     00:01,         3561,     A,  -,  -
01:57:19,  07039,     000%,     00:01,         3561,     A,  -,  -
01:58:19,  07099,     000%,     00:01,         3561,     A,  -,  -
01:59:19,  07159,     000%,     00:01,         3561,     A,  -,  -
02:00:19,  07219,     000%,     00:01,         3498,     A,  -,  -
02:01:19,  07279,     000%,     00:01,         3498,     A,  -,  -
02:02:19,  07339,     000%,     00:01,         3561,     A,  -,  -
02:03:19,  07399,     000%,     00:01,         3498,     A,  -,  -
02:04:19,  07459,     000%,     00:01,         3498,     A,  -,  -
02:05:20,  07520,     000%,     00:01,         3498,     A,  -,  -
02:06:20,  07580,     000%,     00:01,         3498,     A,  -,  -
02:07:20,  07640,     000%,     00:01,         3434,     A,  -,  -
02:08:20,  07700,     000%,     00:01,         3434,     A,  -,  -
02:09:20,  07760,     000%,     00:01,         3434,     A,  -,  -
02:10:20,  07820,     000%,     00:01,         3498,     A,  -,  -
02:11:20,  07880,     000%,     00:01,         3498,     A,  -,  -
02:12:20,  07940,     000%,     00:01,         3434,     A,  -,  -
02:13:20,  08000,     000%,     00:01,         3434,     A,  -,  -
02:14:20,  08060,     000%,     00:01,         3434,     A,  -,  -
02:15:20,  08120,     000%,     00:01,         3434,     A,  -,  -
02:16:20,  08180,     000%,     00:01,         3434,     A,  -,  -
02:17:20,  08240,     000%,     00:01,         3434,     A,  -,  -
02:18:20,  08300,     000%,     00:01,         3434,     A,  -,  -
02:19:20,  08360,     000%,     00:01,         3434,     A,  -,  -
02:20:20,  08420,     000%,     00:01,         3434,     A,  -,  -
02:21:20,  08480,     000%,     00:01,         3434,     A,  -,  -
02:22:20,  08540,     000%,     00:01,         3434,     A,  -,  -
02:23:20,  08600,     000%,     00:01,         3434,     A,  -,  -
02:24:20,  08660,     000%,     00:01,         3434,     A,  -,  -
02:25:20,  08720,     000%,     00:01,         3370,     A,  -,  -
02:26:20,  08780,     000%,     00:01,         3307,     A,  -,  -
02:27:20,  08840,     000%,     00:01,         3370,     A,  -,  -
02:28:20,  08900,     000%,     00:01,         3370,     A,  -,  -
02:29:20,  08960,     000%,     00:01,         3307,     A,  -,  -
02:30:20,  09020,     000%,     00:01,         3307,     A,  -,  -
02:31:20,  09080,     000%,     00:01,         3307,     A,  -,  -
02:32:20,  09140,     000%,     00:01,         3307,     A,  -,  -
02:33:21,  09201,     000%,     00:01,         3243,     A,  -,  -
02:34:21,  09261,     000%,     00:01,         3243,     A,  -,  -
02:35:21,  09321,     000%,     00:01,         3243,     A,  -,  -
02:36:21,  09381,     000%,     00:01,         3243,     A,  -,  -
02:36:48,  09408,     000%,     00:01,         3211,     A,  -,  -
02:37:48,  09468,     000%,     00:01,         3243,     A,  -,  -
02:38:48,  09528,     000%,     00:01,         3243,     A,  -,  -
02:39:48,  09588,     000%,     00:01,         3180,     A,  -,  -
02:40:48,  09648,     000%,     00:01,         3180,     A,  -,  -
02:41:48,  09708,     000%,     00:01,         3180,     A,  -,  -
02:42:49,  09769,     000%,     00:01,         3180,     A,  -,  -
02:43:49,  09829,     000%,     00:01,         3180,     A,  -,  -
02:44:49,  09889,     000%,     00:01,         3180,     A,  -,  -
02:45:49,  09949,     000%,     00:01,         3180,     A,  -,  -
02:46:49,  10009,     000%,     00:01,         3180,     A,  -,  -
02:47:49,  10069,     000%,     00:01,         3148,     A,  -,  -
02:48:49,  10129,     000%,     00:01,         3180,     A,  -,  -
02:49:49,  10189,     000%,     00:01,         3180,     A,  -,  -
02:50:49,  10249,     000%,     00:01,         3116,     A,  -,  -
02:51:49,  10309,     000%,     00:01,         3180,     A,  -,  -
02:52:49,  10369,     000%,     00:01,         3116,     A,  -,  -
02:53:49,  10429,     000%,     00:01,         3116,     A,  -,  -
02:54:49,  10489,     000%,     00:01,         3180,     A,  -,  -
02:55:49,  10549,     000%,     00:01,         3180,     A,  -,  -
02:56:49,  10609,     000%,     00:01,         3116,     A,  -,  -
02:57:49,  10669,     000%,     00:01,         3116,     A,  -,  -
02:58:49,  10729,     000%,     00:01,         3116,     A,  -,  -
02:59:49,  10789,     000%,     00:01,         3084,     A,  -,  -
03:00:49,  10849,     000%,     00:01,         3116,     A,  -,  -
03:01:49,  10909,     000%,     00:01,         3052,     A,  -,  -
03:02:49,  10969,     000%,     00:01,         3052,     A,  -,  -
03:03:49,  11029,     000%,     00:01,         3052,     A,  -,  -
03:04:49,  11089,     000%,     00:01,         2989,     A,  -,  -
03:05:49,  11149,     000%,     00:01,         2989,     A,  -,  -
03:06:49,  11209,     000%,     00:01,         2925,     A,  -,  -
03:07:49,  11269,     000%,     00:01,         2925,     A,  -,  -
03:08:50,  11330,     000%,     00:01,         2862,     A,  -,  -
03:09:50,  11390,     000%,     00:01,         2830,     A,  -,  -
03:10:50,  11450,     000%,     00:01,         2798,     A,  -,  -
03:11:50,  11510,     000%,     00:01,         2798,     A,  -,  -
03:12:50,  11570,     000%,     00:01,         2798,     A,  -,  -
03:13:50,  11630,     000%,     00:01,         2766,     A,  -,  -
03:14:50,  11690,     000%,     00:01,         2734,     A,  -,  -
03:15:50,  11750,     000%,     00:01,         2734,     A,  -,  -
03:16:50,  11810,     000%,     00:01,         2734,     A,  -,  -
03:17:50,  11870,     000%,     00:01,         2734,     A,  -,  -
03:18:50,  11930,     000%,     00:01,         2734,     A,  -,  -
03:19:50,  11990,     000%,     00:01,         2734,     A,  -,  -
03:20:50,  12050,     000%,     00:01,         2671,     A,  -,  -
03:21:43,  12103,     000%,     00:01,         2385,     A,  -,  -
03:21:43,  12103,     000%,     00:01,         2353,     A,  -,  -
03:22:19,  12139,     000%,     00:01,         2226,     A,  -,  -
03:22:20,  12140,     000%,     00:01,         2226,     A,  -,  -
03:23:20,  12200,     000%,     00:01,         2289,     A,  -,  -
03:24:20,  12260,     000%,     00:01,         2544,     A,  -,  -
03:25:20,  12320,     000%,     00:01,         2544,     A,  -,  -
03:26:20,  12380,     000%,     00:01,         2544,     A,  -,  -
03:27:20,  12440,     000%,     00:01,         2544,     A,  -,  -
03:28:20,  12500,     000%,     00:01,         2544,     A,  -,  -
03:29:20,  12560,     000%,     00:01,         2544,     A,  -,  -
03:30:20,  12620,     000%,     00:01,         2544,     A,  -,  -
03:31:20,  12680,     000%,     00:01,         2544,     A,  -,  -
03:32:20,  12740,     000%,     00:01,         2480,     A,  -,  -
03:33:20,  12800,     000%,     00:01,         2544,     A,  -,  -
03:34:20,  12860,     000%,     00:01,         2544,     A,  -,  -
03:35:20,  12920,     000%,     00:01,         2480,     A,  -,  -
03:36:20,  12980,     000%,     00:01,         2480,     A,  -,  -
03:37:20,  13040,     000%,     00:01,         2480,     A,  -,  -
03:38:20,  13100,     000%,     00:01,         2480,     A,  -,  -
03:39:20,  13160,     000%,     00:01,         2353,     A,  -,  -
03:40:20,  13220,     000%,     00:01,         2416,     A,  -,  -
03:41:20,  13280,     000%,     00:01,         2353,     A,  -,  -
03:42:20,  13340,     000%,     00:01,         2353,     A,  -,  -
03:43:20,  13400,     000%,     00:01,         2289,     A,  -,  -
03:44:20,  13460,     000%,     00:01,         2289,     A,  -,  -
03:45:20,  13520,     000%,     00:01,         2289,     A,  -,  -
03:46:20,  13580,     000%,     00:01,         2226,     A,  -,  -
03:47:20,  13640,     000%,     00:01,         2226,     A,  -,  -
03:48:20,  13700,     000%,     00:01,         2162,     A,  -,  -
03:49:20,  13760,     000%,     00:01,         2162,     A,  -,  -
03:50:20,  13820,     000%,     00:01,         2035,     A,  -,  -
03:50:24,  13824,     000%,     00:01,         1939,     A,  -,  -
03:51:24,  13884,     000%,     00:01,         2035,     A,  -,  -
03:52:24,  13944,     000%,     00:01,         2098,     A,  -,  -
03:53:24,  14004,     000%,     00:01,         2098,     A,  -,  -
03:54:24,  14064,     000%,     00:01,         2098,     A,  -,  -
03:55:24,  14124,     000%,     00:01,         2098,     A,  -,  -
03:56:24,  14184,     000%,     00:01,         2067,     A,  -,  -
03:57:24,  14244,     000%,     00:01,         2035,     A,  -,  -
03:58:24,  14304,     000%,     00:01,         2035,     A,  -,  -
03:59:24,  14364,     000%,     00:01,         2035,     A,  -,  -
04:00:24,  14424,     000%,     00:01,         2035,     A,  -,  -
04:01:24,  14484,     000%,     00:01,         2035,     A,  -,  -
04:02:24,  14544,     000%,     00:01,         2035,     A,  -,  -
04:03:24,  14604,     000%,     00:01,         1971,     A,  -,  -
04:04:24,  14664,     000%,     00:01,         1971,     A,  -,  -
04:05:24,  14724,     000%,     00:01,         1971,     A,  -,  -
04:06:24,  14784,     000%,     00:01,         1908,     A,  -,  -
04:07:24,  14844,     000%,     00:01,         1908,     A,  -,  -
04:08:24,  14904,     000%,     00:01,         1908,     A,  -,  -
04:09:24,  14964,     000%,     00:01,         1908,     A,  -,  -
04:10:24,  15024,     000%,     00:01,         1908,     A,  -,  -
04:11:25,  15085,     000%,     00:01,         1908,     A,  -,  -
04:12:25,  15145,     000%,     00:01,         1908,     A,  -,  -
04:13:25,  15205,     000%,     00:01,         1908,     A,  -,  -
04:14:25,  15265,     000%,     00:01,         1908,     A,  -,  -
04:15:25,  15325,     000%,     00:01,         1908,     A,  -,  -
04:16:25,  15385,     000%,     00:01,         1908,     A,  -,  -
04:17:25,  15445,     000%,     00:01,         1844,     A,  -,  -

--- End quote ---

funman:

--- Quote from: ranma on February 11, 2010, 11:38:57 AM ---Ok, I've got it.  On my c200v2 backlight is controlled by A7 instead of A5.
I now have working backlight.
Also interesting:
Even though I've disabled the USB detection it reacts to USB plug/unplug as if a button was pressed.
i.e. the buttonlight goes on and display is switched on if it was off.

--- End quote ---

bertrik can you test if setting both A5 & A7 has any incidence ?


--- Quote from: ranma on February 11, 2010, 11:38:57 AM ---Ok, I've now found out that the reaction to USB plug/unplug is due to the SYS_CHARGER_CONNECTED and SYS_CHARGER_DISCONNECTED events.

--- End quote ---

Can you see if a GPIO pin is changed when inserting USB (in debug menu > view ports) ?

ranma:

--- Quote from: funman on February 12, 2010, 07:38:23 AM ---
--- Quote from: ranma on February 11, 2010, 11:38:57 AM ---Ok, I've now found out that the reaction to USB plug/unplug is due to the SYS_CHARGER_CONNECTED and SYS_CHARGER_DISCONNECTED events.

--- End quote ---

Can you see if a GPIO pin is changed when inserting USB (in debug menu > view ports) ?

--- End quote ---

I checked that, unfortunately I don't see any change on the ports if I plug in USB.
Neither on GPIO nor on DBOP_DIN.

[edit]
I had a look at the AS3525 datasheet. There is the AS3514 IRQ_ENRD_0 register, which is already used to check for the charger status (bit 5) and it provides usb status (bit 3).

I added IRQ_ENRD_0 readout to the GPIO debug function and indeed it changes from 0x00 to 0x28
when i plug in USB (charger connected, usb connected). Maybe that could be used instead of GPIO?
[/edit]

[edit2]
BTW I checked DCDC15, it doesn't affect brightness.
The way the OF behaves it looks like it's doing PWM in software for the brightness controls.
If I wave my Sansa, on the brightest settings I see a continuous light,
on the lowest settings it looks like 50% duty cycle, on medium setting more like 75%.
I've pimped the GPIO debug screen to include more stuff I was interested in:
ADC values (BVDD, VRTC, UVDD, CHGI, VBE1, VBE2, BTMP, CVDD), DCDC15 (to doublecheck that was really set by my modified brightness setting function), IENRD0 and CHARGER registers of AS3514.
[/edit2]

[edit3]
With this usb detection within booted rockbox works for me (using as3514 to read usb state and a seperate thread since usb_detect is called from the timer tick). Possibly the thread should sleep less long since usb.c also debounces the usb_detect value AFAICS.
[edit4]
Well, the as3525 is debouncing this one in hardware so it should be okay
[/edit4]

--- Code: ---Index: usb-as3525.c
===================================================================
--- usb-as3525.c (revision 24590)
+++ usb-as3525.c (working copy)
@@ -28,6 +28,8 @@
 #include "usb-target.h"
 #include "power.h"
 #include "as3525.h"
+#include "ascodec.h"
+#include "thread.h"
 
 #if defined(SANSA_CLIP)
 #define USB_DETECT_PIN 6
@@ -39,6 +41,11 @@
 #define USB_DETECT_PIN 1
 #endif
 
+static long detect_stack[DEFAULT_STACK_SIZE/sizeof(long)];
+static const char detect_thread_name[] = "usbdetect";
+static unsigned int detect_thread_entry = 0;
+static int detect_state = USB_EXTRACTED;
+
 void usb_enable(bool on)
 {
 #ifdef HAVE_USBSTACK
@@ -51,19 +58,26 @@
 #endif
 }
 
+static void detect_thread(void)
+{
+    while(1)
+    {
+        if (ascodec_read(AS3514_IRQ_ENRD0) & (1<<3))
+            detect_state = USB_INSERTED;
+        else
+            detect_state = USB_EXTRACTED;
+        sleep(HZ/10);
+    }
+}
+
 void usb_init_device(void)
 {
-#ifdef USB_DETECT_PIN
-    GPIOA_DIR &= ~(1 << USB_DETECT_PIN); /* set as input */
-#endif
+    detect_thread_entry = create_thread(detect_thread, detect_stack,
+                          sizeof(detect_stack), 0, detect_thread_name
+                          IF_PRIO(, PRIORITY_SYSTEM) IF_COP(, CPU));
 }
 
 int usb_detect(void)
 {
-#ifdef USB_DETECT_PIN
-    if (GPIOA_PIN( USB_DETECT_PIN ))
-        return USB_INSERTED;
-    else
-#endif
-        return USB_EXTRACTED;
+    return detect_state;
 }

--- End code ---
[/edit3]

FlynDice:
Well I hope it's not just because I'm lucky that myclip+ is still breathing but let me at least document here what I did with it.

I've got a 2Gb clip+.
When I got it I plugged in USB and let it charge until the battery was full.
Then I turned it on and checked out the OF for a bit then turned it off.
Then I upgraded the OF with clppa.bin dated 16 December 2009, 20:37 from clipplus01.02.09.zip
Then I turned it on and checked out the new OF for a bit then turned it off again.
I modified mkamsboot.c so that clip+ would work and patched the firmware.
I did have a bit of a problem here that you can read from posts a few pages back including pastie diffs  http://forums.rockbox.org/index.php?topic=14064.msg161589#msg161589.
Once I figured things out I made a correctly patched firmware with svn dualboot.S(~.5 sec delay) and loaded it successfully.
Hard to see a .5 sec delay so I made it a 6 second delay, patched & loaded succesfully.
I then started testing buttons with this code: http://pastie.org/822205     with results shown in the .pdf attached to this post:   http://forums.rockbox.org/index.php?topic=14064.msg161676#msg161676
At this point I attempted to see I f I could make dualboot work by simply reading C3(left button), if high immediate branch to OF, if not 6 sec delay and it worked.
I then used this as my "escape hatch" for testing more code that involves setting B0 etc.

I have successfully dualbooted with the current code over 50 times while checking for delays trying to read registers one bit at a time....

My hope is someone can spot something different here that may be significant.

funman:
mt do you still have the clppa.bin you copied on your clip+ ?

btw the delay to power off is longer on Clipv2/+ than Clipv1 and closer to 15/20 seconds.

If you're sure it is dead, could you open it and try the e200v2 recovery trick ?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version